codercengiz
Committed by GitHub

Update internacionalization.dart

Fixes #2039 
Localization don't work for Locale('en_US') or Locale('de_DE')

With this change, it supports both situations:
When locale has only language code like Locale('en') or Locale('en_US')
... ... @@ -69,13 +69,13 @@ extension Trans on String {
final translationsWithNoCountry = Get.translations
.map((key, value) => MapEntry(key.split("_").first, value));
final containsKey =
translationsWithNoCountry.containsKey(Get.locale!.languageCode);
translationsWithNoCountry.containsKey(Get.locale!.languageCode.split("_").first);
if (!containsKey) {
return null;
}
return translationsWithNoCountry[Get.locale!.languageCode];
return translationsWithNoCountry[Get.locale!.languageCode.split("_").first];
}
String get tr {
... ...