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 7abce3d commit d2ae836
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 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 @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d2ae836

Please sign in to comment.