lookupTranslations function
Implementation
Translations lookupTranslations(Locale locale) {
// Lookup logic when language+country codes are specified.
switch (locale.languageCode) {
case 'zh':
{
switch (locale.countryCode) {
case 'TW':
return TranslationsZhTw();
}
break;
}
}
// Lookup logic when only language code is specified.
switch (locale.languageCode) {
case 'ar':
return TranslationsAr();
case 'de':
return TranslationsDe();
case 'en':
return TranslationsEn();
case 'es':
return TranslationsEs();
case 'fr':
return TranslationsFr();
case 'hi':
return TranslationsHi();
case 'hu':
return TranslationsHu();
case 'lt':
return TranslationsLt();
case 'ms':
return TranslationsMs();
case 'pt':
return TranslationsPt();
case 'ru':
return TranslationsRu();
case 'sv':
return TranslationsSv();
case 'zh':
return TranslationsZh();
}
throw FlutterError(
'Translations.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration '
'that was used.');
}