Merge pull request #281 from PaperCube/main

This commit is contained in:
lollipopkit
2024-02-13 12:46:57 +08:00
committed by GitHub
13 changed files with 27 additions and 26 deletions

View File

@@ -163,7 +163,7 @@ abstract class S {
/// No description provided for @askContinue.
///
/// In en, this message translates to:
/// **'{msg}, continue?'**
/// **'{msg}. Continue?'**
String askContinue(Object msg);
/// No description provided for @attention.
@@ -1621,7 +1621,7 @@ abstract class S {
/// No description provided for @useNoPwd.
///
/// In en, this message translates to:
/// **'No password will be used.'**
/// **'No password will be used'**
String get useNoPwd;
/// No description provided for @used.

View File

@@ -36,7 +36,7 @@ class SDe extends S {
@override
String askContinue(Object msg) {
return '$msg, weiter?';
return '$msg. Weiter?';
}
@override
@@ -800,7 +800,7 @@ class SDe extends S {
String get urlOrJson => 'URL oder JSON';
@override
String get useNoPwd => 'Es wird kein Passwort verwendet.';
String get useNoPwd => 'Es wird kein Passwort verwendet';
@override
String get used => 'Gebraucht';

View File

@@ -36,7 +36,7 @@ class SEn extends S {
@override
String askContinue(Object msg) {
return '$msg, continue?';
return '$msg. Continue?';
}
@override
@@ -800,7 +800,7 @@ class SEn extends S {
String get urlOrJson => 'URL or JSON';
@override
String get useNoPwd => 'No password will be used.';
String get useNoPwd => 'No password will be used';
@override
String get used => 'Used';

View File

@@ -36,7 +36,7 @@ class SFr extends S {
@override
String askContinue(Object msg) {
return '$msg, continuer?';
return '$msg. Continuer?';
}
@override
@@ -800,7 +800,7 @@ class SFr extends S {
String get urlOrJson => 'URL ou JSON';
@override
String get useNoPwd => 'Aucun mot de passe ne sera utilisé.';
String get useNoPwd => 'Aucun mot de passe ne sera utilisé';
@override
String get used => 'Utilisé';

View File

@@ -800,7 +800,7 @@ class SId extends S {
String get urlOrJson => 'URL atau JSON';
@override
String get useNoPwd => 'Tidak ada kata sandi yang akan digunakan.';
String get useNoPwd => 'Tidak ada kata sandi yang akan digunakan';
@override
String get used => 'Digunakan';

View File

@@ -800,7 +800,7 @@ class SZh extends S {
String get urlOrJson => '链接或JSON';
@override
String get useNoPwd => '将会使用无密码';
String get useNoPwd => '将会使用无密码';
@override
String get used => '已用';
@@ -1651,7 +1651,7 @@ class SZhTw extends SZh {
String get urlOrJson => '鏈接或JSON';
@override
String get useNoPwd => '将使用無密碼';
String get useNoPwd => '将使用無密碼';
@override
String get used => '已用';

View File

@@ -10,7 +10,7 @@
"all": "Alle",
"alreadyLastDir": "Bereits im letzten Verzeichnis.",
"alterUrl": "Url ändern",
"askContinue": "{msg}, weiter?",
"askContinue": "{msg}. Weiter?",
"attention": "Achtung",
"authRequired": "Autorisierung erforderlich",
"auto": "System folgen",
@@ -253,7 +253,7 @@
"upsideDown": "Upside Down",
"uptime": "Betriebszeit",
"urlOrJson": "URL oder JSON",
"useNoPwd": "Es wird kein Passwort verwendet.",
"useNoPwd": "Es wird kein Passwort verwendet",
"used": "Gebraucht",
"user": "Benutzer",
"versionHaveUpdate": "Gefunden: v1.0.{build}, klicke zum Aktualisieren",

View File

@@ -10,7 +10,7 @@
"all": "All",
"alreadyLastDir": "Already in last directory.",
"alterUrl": "Alter url",
"askContinue": "{msg}, continue?",
"askContinue": "{msg}. Continue?",
"attention": "Attention",
"authRequired": "Auth required",
"auto": "Auto",
@@ -253,7 +253,7 @@
"upsideDown": "Upside Down",
"uptime": "Uptime",
"urlOrJson": "URL or JSON",
"useNoPwd": "No password will be used.",
"useNoPwd": "No password will be used",
"used": "Used",
"user": "User",
"versionHaveUpdate": "Found: v1.0.{build}, click to update",

View File

@@ -10,7 +10,7 @@
"all": "Tous",
"alreadyLastDir": "Déjà dans le dernier répertoire.",
"alterUrl": "Modifier l'URL",
"askContinue": "{msg}, continuer?",
"askContinue": "{msg}. Continuer?",
"attention": "Attention",
"authRequired": "Authentification requise",
"auto": "Auto",
@@ -253,7 +253,7 @@
"upsideDown": "À l'envers",
"uptime": "Temps de disponibilité",
"urlOrJson": "URL ou JSON",
"useNoPwd": "Aucun mot de passe ne sera utilisé.",
"useNoPwd": "Aucun mot de passe ne sera utilisé",
"used": "Utilisé",
"user": "Utilisateur",
"versionHaveUpdate": "Trouvé : v1.0.{build}, cliquez pour mettre à jour",

View File

@@ -253,7 +253,7 @@
"upsideDown": "Terbalik",
"uptime": "Uptime",
"urlOrJson": "URL atau JSON",
"useNoPwd": "Tidak ada kata sandi yang akan digunakan.",
"useNoPwd": "Tidak ada kata sandi yang akan digunakan",
"used": "Digunakan",
"user": "Username",
"versionHaveUpdate": "Ditemukan: v1.0.{build}, klik untuk memperbarui",

View File

@@ -253,7 +253,7 @@
"upsideDown": "上下交换",
"uptime": "启动时长",
"urlOrJson": "链接或JSON",
"useNoPwd": "将会使用无密码",
"useNoPwd": "将会使用无密码",
"used": "已用",
"user": "用户",
"versionHaveUpdate": "找到新版本v1.0.{build}, 点击更新",

View File

@@ -253,7 +253,7 @@
"upsideDown": "上下交換",
"uptime": "啟動時長",
"urlOrJson": "鏈接或JSON",
"useNoPwd": "将使用無密碼",
"useNoPwd": "将使用無密碼",
"used": "已用",
"user": "用戶",
"versionHaveUpdate": "找到新版本v1.0.{build}, 點擊更新",

View File

@@ -118,12 +118,16 @@ class _PrivateKeyEditPageState extends State<PrivateKeyEditPage> {
);
}
String _standardizeLineSeparators(String value) {
return value.replaceAll("\r\n", "\n").replaceAll("\r", "\n");
}
Widget _buildFAB() {
return FloatingActionButton(
tooltip: l10n.save,
onPressed: () async {
final name = _nameController.text;
final key = _keyController.text.trim();
final key = _standardizeLineSeparators(_keyController.text.trim());
final pwd = _pwdController.text;
if (name.isEmpty || key.isEmpty) {
context.showSnackBar(l10n.fieldMustNotEmpty);
@@ -201,11 +205,8 @@ class _PrivateKeyEditPageState extends State<PrivateKeyEditPage> {
}
final content = await file.readAsString();
/// Issue #7
/// Replace all CRLF to LF
content.replaceAll('\r\n', '\n');
_keyController.text = content;
// dartssh2 accepts only LF (but not CRLF or CR)
_keyController.text = _standardizeLineSeparators(content.trim());
},
child: Text(l10n.pickFile),
),