Skip to content

Commit

Permalink
Fallback to Czech translations for deprecated language code "cz"
Browse files Browse the repository at this point in the history
  • Loading branch information
erdemyerebasmaz committed Jun 25, 2024
1 parent 4d5fed1 commit fa62b5f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/bloc/user_profile/profile_animal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ extension ProfileAnimalExtension on ProfileAnimal {

Map<String, Map<String, ProfileAnimal>> _animalsFromName = {
"bg": _buildAnimalsFromName(BreezTranslationsBg()),
"cz": _buildAnimalsFromName(BreezTranslationsCs()),
"cs": _buildAnimalsFromName(BreezTranslationsCs()),
"de": _buildAnimalsFromName(BreezTranslationsDe()),
"el": _buildAnimalsFromName(BreezTranslationsEl()),
Expand Down
1 change: 1 addition & 0 deletions lib/bloc/user_profile/profile_color.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ extension ProfileColorExtension on ProfileColor {

Map<String, Map<String, ProfileColor>> _colorsFromName = {
"bg": _buildColorsFromName(BreezTranslationsBg()),
"cz": _buildColorsFromName(BreezTranslationsCs()),
"cs": _buildColorsFromName(BreezTranslationsCs()),
"de": _buildColorsFromName(BreezTranslationsDe()),
"el": _buildColorsFromName(BreezTranslationsEl()),
Expand Down
4 changes: 3 additions & 1 deletion lib/routes/security/widget/security_pin_interval.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ class SecurityPinInterval extends StatelessWidget {
if (seconds == 0) {
return texts.security_and_backup_lock_automatically_option_immediate;
}
// Duration plugin falsely treats country code "cz" as the Czech language code. Issue: https://github.com/desktop-dart/duration/issues/67
String languageCode = texts.locale == "cs" ? "cz" : texts.locale;
return prettyDuration(
Duration(seconds: seconds),
locale: DurationLocale.fromLanguageCode(texts.locale) ?? const EnglishDurationLocale(),
locale: DurationLocale.fromLanguageCode(languageCode) ?? const EnglishDurationLocale(),
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "79ad21b70c7f0a71da25acbde42f569cc44e0c61"
resolved-ref: "79ad21b70c7f0a71da25acbde42f569cc44e0c61"
ref: a564088448149e9c28b4a2eb82fa0a3536698d24
resolved-ref: a564088448149e9c28b4a2eb82fa0a3536698d24
url: "https://github.com/breez/Breez-Translations"
source: git
version: "1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies:
breez_translations:
git:
url: https://github.com/breez/Breez-Translations
ref: 79ad21b70c7f0a71da25acbde42f569cc44e0c61
ref: a564088448149e9c28b4a2eb82fa0a3536698d24
clipboard_watcher: ^0.2.1
csv: ^6.0.0
connectivity_plus: ^6.0.3
Expand Down

0 comments on commit fa62b5f

Please sign in to comment.