Skip to content

Commit

Permalink
Locale changes
Browse files Browse the repository at this point in the history
  • Loading branch information
yekta committed Mar 5, 2024
1 parent a1155b0 commit 21bb01b
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 23 deletions.
43 changes: 29 additions & 14 deletions lib/localization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -873,34 +873,49 @@ class AppLocalization {
}

String get defaultNewAccountNameAdHoc {
return Intl.message("Imported %1",
return Intl.message("Imported Account %1",
desc:
"Default new account name for accounts imported with a different seed - e.g. Imported #1",
"Default new account name for accounts imported with a different seed - e.g. Imported 1",
name: 'defaultNewAccountNameAdHoc');
}

String get externalAccountImportedSuccess {
String get importedAdHocAccountBadge {
return Intl.message("Imported Account",
desc: "The badge for imported accounts",
name: 'importedAdHocAccountBadge');
}

String get adHocAccountImportedSuccess {
return Intl.message("Account imported successfully",
desc: "External account imported success",
name: 'externalAccountImportedSuccess');
desc: "Account imported success", name: 'adHocAccountImportedSuccess');
}

String get externalAccountImportedError {
String get adHocAccountImportedError {
return Intl.message("Failed to import account",
desc: "External account imported error",
name: 'externalAccountImportedError');
desc: "Account imported error", name: 'adHocAccountImportedError');
}

String get externalAccountInvalidIndex {
String get adHocAccountInvalidIndex {
return Intl.message("Invalid index",
desc: "External account invalid index",
name: 'externalAccountInvalidIndex');
desc: "Ad hoc account invalid index", name: 'adHocAccountInvalidIndex');
}

String get externalAccountAlreadyExists {
String get importedAdHocAccountAlreadyExists {
return Intl.message("Account already exists",
desc: "External account already exists",
name: 'externalAccountalreadyExists');
desc: "Imported account already exists",
name: 'importedAdHocAccountalreadyExists');
}

String get accountsMoreOptionsMenuTitle {
return Intl.message("More Options",
desc: "Title for the more options menu",
name: 'accountsMoreOptionsMenuTitle');
}

String get accountsMoreOptionsMenuImportAccountOption {
return Intl.message("Import Account",
desc: "Import account option in the more options menu",
name: 'accountsMoreOptionsMenuImportAccountOption');
}

String get newAccountIntroKal {
Expand Down
3 changes: 1 addition & 2 deletions lib/model/db/appdb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,7 @@ class DBHelper {
for (int i = 0; i < accounts.length; i++) {
nextID++;
}
String nextName =
nameBuilder.replaceAll("%1", "AdHoc #${nextID.toString()}");
String nextName = nameBuilder.replaceAll("%1", "${nextID.toString()}");
String address = NanoUtil.privateToAddress(privateKey);
account = Account(
id: 0,
Expand Down
10 changes: 6 additions & 4 deletions lib/ui/accounts/accounts_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class _AppAccountsWidgetState extends State<AppAccountsWidget> {
}
});
sl.get<UIUtil>().showSnackbar(
AppLocalization.of(context).externalAccountImportedSuccess, context);
AppLocalization.of(context).adHocAccountImportedSuccess, context);
}

Future<void> _requestBalances(
Expand Down Expand Up @@ -421,7 +421,7 @@ class _AppAccountsWidgetState extends State<AppAccountsWidget> {
title: Container(
margin: EdgeInsets.only(bottom: 10),
child: Text(
"More Options",
AppLocalization.of(context).accountsMoreOptionsMenuTitle,
style: AppStyles.textStyleDialogHeader(context),
),
),
Expand All @@ -437,7 +437,8 @@ class _AppAccountsWidgetState extends State<AppAccountsWidget> {
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Text(
"Import External Account",
AppLocalization.of(context)
.accountsMoreOptionsMenuImportAccountOption,
style: AppStyles.textStyleDialogOptions(context),
),
),
Expand Down Expand Up @@ -563,7 +564,8 @@ class _AppAccountsWidgetState extends State<AppAccountsWidget> {
.primary10,
),
child: AutoSizeText(
"External Account",
AppLocalization.of(context)
.importedAdHocAccountBadge,
minFontSize: 8.0,
stepGranularity: 0.1,
maxLines: 1,
Expand Down
6 changes: 3 additions & 3 deletions lib/ui/accounts/import_external_account_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ class _ImportExternalAccountSheetState
if (selectedIndex == null || selectedIndex < 0) {
sl.get<UIUtil>().showSnackbar(
AppLocalization.of(context)
.externalAccountInvalidIndex,
.adHocAccountInvalidIndex,
context);
return;
}
Expand All @@ -561,7 +561,7 @@ class _ImportExternalAccountSheetState
if (accountExists) {
sl.get<UIUtil>().showSnackbar(
AppLocalization.of(context)
.externalAccountAlreadyExists,
.importedAdHocAccountAlreadyExists,
context);
return;
}
Expand All @@ -579,7 +579,7 @@ class _ImportExternalAccountSheetState
sl.get<Logger>().e("Error importing account: $e");
sl.get<UIUtil>().showSnackbar(
AppLocalization.of(context)
.externalAccountImportedError,
.adHocAccountImportedError,
context);
}
}),
Expand Down

0 comments on commit 21bb01b

Please sign in to comment.