lookupFluentLocalizations function

FluentLocalizations lookupFluentLocalizations(
  1. Locale locale
)

Implementation

FluentLocalizations lookupFluentLocalizations(Locale locale) {
  // Lookup logic when language+script codes are specified.
  switch (locale.languageCode) {
    case 'zh':
      {
        switch (locale.scriptCode) {
          case 'Hant':
            return FluentLocalizationsZhHant();
        }
        break;
      }
  }

  // Lookup logic when only language code is specified.
  switch (locale.languageCode) {
    case 'ar':
      return FluentLocalizationsAr();
    case 'be':
      return FluentLocalizationsBe();
    case 'bn':
      return FluentLocalizationsBn();
    case 'ca':
      return FluentLocalizationsCa();
    case 'cs':
      return FluentLocalizationsCs();
    case 'de':
      return FluentLocalizationsDe();
    case 'el':
      return FluentLocalizationsEl();
    case 'en':
      return FluentLocalizationsEn();
    case 'es':
      return FluentLocalizationsEs();
    case 'fa':
      return FluentLocalizationsFa();
    case 'fr':
      return FluentLocalizationsFr();
    case 'he':
      return FluentLocalizationsHe();
    case 'hi':
      return FluentLocalizationsHi();
    case 'hr':
      return FluentLocalizationsHr();
    case 'hu':
      return FluentLocalizationsHu();
    case 'id':
      return FluentLocalizationsId();
    case 'it':
      return FluentLocalizationsIt();
    case 'ja':
      return FluentLocalizationsJa();
    case 'ko':
      return FluentLocalizationsKo();
    case 'ku':
      return FluentLocalizationsKu();
    case 'ms':
      return FluentLocalizationsMs();
    case 'my':
      return FluentLocalizationsMy();
    case 'nl':
      return FluentLocalizationsNl();
    case 'pl':
      return FluentLocalizationsPl();
    case 'pt':
      return FluentLocalizationsPt();
    case 'ro':
      return FluentLocalizationsRo();
    case 'ru':
      return FluentLocalizationsRu();
    case 'sk':
      return FluentLocalizationsSk();
    case 'sv':
      return FluentLocalizationsSv();
    case 'ta':
      return FluentLocalizationsTa();
    case 'th':
      return FluentLocalizationsTh();
    case 'tr':
      return FluentLocalizationsTr();
    case 'uk':
      return FluentLocalizationsUk();
    case 'ur':
      return FluentLocalizationsUr();
    case 'uz':
      return FluentLocalizationsUz();
    case 'vi':
      return FluentLocalizationsVi();
    case 'zh':
      return FluentLocalizationsZh();
  }

  throw FlutterError(
      'FluentLocalizations.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.');
}