From d2ae8369b52d0550987b405eb4b9c158e107d5ef Mon Sep 17 00:00:00 2001 From: Erdem Yerebasmaz Date: Tue, 25 Jun 2024 12:49:23 +0300 Subject: [PATCH] Fallback to Czech translations for deprecated language code "cz" --- lib/bloc/user_profile/profile_animal.dart | 1 + lib/bloc/user_profile/profile_color.dart | 1 + lib/routes/security/widget/security_pin_interval.dart | 4 +++- pubspec.lock | 4 ++-- pubspec.yaml | 4 ++-- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/bloc/user_profile/profile_animal.dart b/lib/bloc/user_profile/profile_animal.dart index e57aeda4..766c859a 100644 --- a/lib/bloc/user_profile/profile_animal.dart +++ b/lib/bloc/user_profile/profile_animal.dart @@ -185,6 +185,7 @@ extension ProfileAnimalExtension on ProfileAnimal { Map> _animalsFromName = { "bg": _buildAnimalsFromName(BreezTranslationsBg()), + "cz": _buildAnimalsFromName(BreezTranslationsCs()), "cs": _buildAnimalsFromName(BreezTranslationsCs()), "de": _buildAnimalsFromName(BreezTranslationsDe()), "el": _buildAnimalsFromName(BreezTranslationsEl()), diff --git a/lib/bloc/user_profile/profile_color.dart b/lib/bloc/user_profile/profile_color.dart index 848166eb..afc66c86 100644 --- a/lib/bloc/user_profile/profile_color.dart +++ b/lib/bloc/user_profile/profile_color.dart @@ -180,6 +180,7 @@ extension ProfileColorExtension on ProfileColor { Map> _colorsFromName = { "bg": _buildColorsFromName(BreezTranslationsBg()), + "cz": _buildColorsFromName(BreezTranslationsCs()), "cs": _buildColorsFromName(BreezTranslationsCs()), "de": _buildColorsFromName(BreezTranslationsDe()), "el": _buildColorsFromName(BreezTranslationsEl()), diff --git a/lib/routes/security/widget/security_pin_interval.dart b/lib/routes/security/widget/security_pin_interval.dart index 1753b63e..591e12f6 100644 --- a/lib/routes/security/widget/security_pin_interval.dart +++ b/lib/routes/security/widget/security_pin_interval.dart @@ -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(), ); } } diff --git a/pubspec.lock b/pubspec.lock index 5dfc87f0..bf8a2a99 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -115,8 +115,8 @@ packages: dependency: "direct main" description: path: "." - ref: "106e187b7290b4bb0ffe5d2e20e4110c893aaf63" - resolved-ref: "106e187b7290b4bb0ffe5d2e20e4110c893aaf63" + ref: a564088448149e9c28b4a2eb82fa0a3536698d24 + resolved-ref: a564088448149e9c28b4a2eb82fa0a3536698d24 url: "https://github.com/breez/Breez-Translations" source: git version: "1.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 053e5ecd..1bebb9be 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,7 +28,7 @@ dependencies: breez_translations: git: url: https://github.com/breez/Breez-Translations - ref: 106e187b7290b4bb0ffe5d2e20e4110c893aaf63 + ref: a564088448149e9c28b4a2eb82fa0a3536698d24 clipboard_watcher: ^0.2.1 csv: ^6.0.0 connectivity_plus: ^6.0.3 @@ -81,7 +81,7 @@ dependencies: path_provider_platform_interface: ^2.1.2 plugin_platform_interface: ^2.1.8 qr_flutter: ^4.1.0 - rxdart: ^0.27.7 + rxdart: ^0.28.0 share_plus: ^9.0.0 shared_preferences: ^2.2.3 shared_preference_app_group: ^1.1.1 # iOS Notification Service extension requirement to access shared preferences