lookupCountryLocalizations function
Lookup function to get the appropriate CountryLocalizations instance
Returns the correct localization class based on the provided locale Falls back to English if the locale is not supported
Implementation
CountryLocalizations lookupCountryLocalizations(Locale locale) {
// Lookup logic when only language code is specified.
switch (locale.languageCode) {
case 'ar':
return CountryLocalizationsAr();
case 'de':
return CountryLocalizationsDe();
case 'en':
return CountryLocalizationsEn();
case 'es':
return CountryLocalizationsEs();
case 'fr':
return CountryLocalizationsFr();
case 'hi':
return CountryLocalizationsHi();
case 'id':
return CountryLocalizationsId();
case 'it':
return CountryLocalizationsIt();
case 'ja':
return CountryLocalizationsJa();
case 'ko':
return CountryLocalizationsKo();
case 'bn':
return CountryLocalizationsBn();
case 'nl':
return CountryLocalizationsNl();
case 'pl':
return CountryLocalizationsPl();
case 'pt':
return CountryLocalizationsPt();
case 'ru':
return CountryLocalizationsRu();
case 'tr':
return CountryLocalizationsTr();
case 'uk':
return CountryLocalizationsUk();
case 'ur':
return CountryLocalizationsUr();
case 'vi':
return CountryLocalizationsVi();
case 'th':
return CountryLocalizationsTh();
case 'zh':
return CountryLocalizationsZh();
}
// Fallback to English for unsupported locales
return CountryLocalizationsEn();
}