From 0763e8460f0d6634e4c0d6332dc440dda47ecc1a Mon Sep 17 00:00:00 2001 From: Ademar Alves de Oliveira Date: Wed, 2 Aug 2023 10:25:58 -0300 Subject: [PATCH] Add Czech language support --- ios/Runner/Info.plist | 5 +++-- lib/bloc/user_profile/default_profile_generator.dart | 7 ++++--- lib/bloc/user_profile/profile_animal.dart | 6 ++++-- lib/bloc/user_profile/profile_color.dart | 6 ++++-- lib/utils/date.dart | 5 +++-- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 7 files changed, 21 insertions(+), 14 deletions(-) diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index ab533f1a5..903a308ee 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -16,16 +16,17 @@ 6.0 CFBundleLocalizations - de en + cs + de el es fi fr it pt - sv sk + sv CFBundleName c_breez diff --git a/lib/bloc/user_profile/default_profile_generator.dart b/lib/bloc/user_profile/default_profile_generator.dart index 517a60647..0204c8d40 100644 --- a/lib/bloc/user_profile/default_profile_generator.dart +++ b/lib/bloc/user_profile/default_profile_generator.dart @@ -22,12 +22,13 @@ class DefaultProfile { case 'pt': return "$animal $color"; - case 'en': - case 'el': + case 'cs': case 'de': + case 'el': + case 'en': case 'fi': - case 'sv': case 'sk': + case 'sv': default: return "$color $animal"; } diff --git a/lib/bloc/user_profile/profile_animal.dart b/lib/bloc/user_profile/profile_animal.dart index fcdcfc5f8..fc7bef3c6 100644 --- a/lib/bloc/user_profile/profile_animal.dart +++ b/lib/bloc/user_profile/profile_animal.dart @@ -1,4 +1,5 @@ import 'package:breez_translations/generated/breez_translations.dart'; +import 'package:breez_translations/generated/breez_translations_cs.dart'; import 'package:breez_translations/generated/breez_translations_de.dart'; import 'package:breez_translations/generated/breez_translations_el.dart'; import 'package:breez_translations/generated/breez_translations_en.dart'; @@ -182,16 +183,17 @@ extension ProfileAnimalExtension on ProfileAnimal { } Map> _animalsFromName = { + "cs": _buildAnimalsFromName(BreezTranslationsCs()), "de": _buildAnimalsFromName(BreezTranslationsDe()), - "en": _buildAnimalsFromName(BreezTranslationsEn()), "el": _buildAnimalsFromName(BreezTranslationsEl()), + "en": _buildAnimalsFromName(BreezTranslationsEn()), "es": _buildAnimalsFromName(BreezTranslationsEs()), "fi": _buildAnimalsFromName(BreezTranslationsFi()), "fr": _buildAnimalsFromName(BreezTranslationsFr()), "it": _buildAnimalsFromName(BreezTranslationsIt()), "pt": _buildAnimalsFromName(BreezTranslationsPt()), - "sv": _buildAnimalsFromName(BreezTranslationsSv()), "sk": _buildAnimalsFromName(BreezTranslationsSk()), + "sv": _buildAnimalsFromName(BreezTranslationsSv()), }; Map _buildAnimalsFromName(BreezTranslations local) => { diff --git a/lib/bloc/user_profile/profile_color.dart b/lib/bloc/user_profile/profile_color.dart index 37adfad93..3a207d3c8 100644 --- a/lib/bloc/user_profile/profile_color.dart +++ b/lib/bloc/user_profile/profile_color.dart @@ -1,4 +1,5 @@ import 'package:breez_translations/generated/breez_translations.dart'; +import 'package:breez_translations/generated/breez_translations_cs.dart'; import 'package:breez_translations/generated/breez_translations_de.dart'; import 'package:breez_translations/generated/breez_translations_el.dart'; import 'package:breez_translations/generated/breez_translations_en.dart'; @@ -177,16 +178,17 @@ extension ProfileColorExtension on ProfileColor { } Map> _colorsFromName = { + "cs": _buildColorsFromName(BreezTranslationsCs()), "de": _buildColorsFromName(BreezTranslationsDe()), - "en": _buildColorsFromName(BreezTranslationsEn()), "el": _buildColorsFromName(BreezTranslationsEl()), + "en": _buildColorsFromName(BreezTranslationsEn()), "es": _buildColorsFromName(BreezTranslationsEs()), "fi": _buildColorsFromName(BreezTranslationsFi()), "fr": _buildColorsFromName(BreezTranslationsFr()), "it": _buildColorsFromName(BreezTranslationsIt()), "pt": _buildColorsFromName(BreezTranslationsPt()), - "sv": _buildColorsFromName(BreezTranslationsSv()), "sk": _buildColorsFromName(BreezTranslationsSk()), + "sv": _buildColorsFromName(BreezTranslationsSv()), }; Map _buildColorsFromName(BreezTranslations local) => { diff --git a/lib/utils/date.dart b/lib/utils/date.dart index 3b386a0ad..6ab789a69 100644 --- a/lib/utils/date.dart +++ b/lib/utils/date.dart @@ -37,15 +37,16 @@ class BreezDateUtils { } static void setupLocales() { + timeago.setLocaleMessages('cs', timeago.CsMessages()); timeago.setLocaleMessages('de', timeago.DeMessages()); - timeago.setLocaleMessages('en', timeago.EnMessages()); timeago.setLocaleMessages('el', timeago.GrMessages()); + timeago.setLocaleMessages('en', timeago.EnMessages()); timeago.setLocaleMessages('es', timeago.EsMessages()); timeago.setLocaleMessages('fi', timeago.FiMessages()); timeago.setLocaleMessages('fr', timeago.FrMessages()); timeago.setLocaleMessages('it', timeago.ItMessages()); timeago.setLocaleMessages('pt', timeago.PtBrMessages()); - timeago.setLocaleMessages('sv', timeago.SvMessages()); timeago.setLocaleMessages('sk', timeago.EnMessages()); // TODO: add sk locale + timeago.setLocaleMessages('sv', timeago.SvMessages()); } } diff --git a/pubspec.lock b/pubspec.lock index 4a2365d04..c93a9b2c1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -100,8 +100,8 @@ packages: dependency: "direct main" description: path: "." - ref: a8951fbebdcac5cd63e58ae5e4f711fcd5aed14b - resolved-ref: a8951fbebdcac5cd63e58ae5e4f711fcd5aed14b + ref: "077a94046e0b7ff9bd1aff225616541dea0ba208" + resolved-ref: "077a94046e0b7ff9bd1aff225616541dea0ba208" url: "https://github.com/breez/Breez-Translations" source: git version: "1.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 24ca70139..4fb13e865 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -23,7 +23,7 @@ dependencies: breez_translations: git: url: https://github.com/breez/Breez-Translations - ref: a8951fbebdcac5cd63e58ae5e4f711fcd5aed14b + ref: 077a94046e0b7ff9bd1aff225616541dea0ba208 clipboard_watcher: ^0.2.0 connectivity_plus: ^4.0.1 drag_and_drop_lists: ^0.3.3