lookupFleatherLocalizations function

FleatherLocalizations lookupFleatherLocalizations(
  1. Locale locale
)

Implementation

FleatherLocalizations lookupFleatherLocalizations(Locale locale) {
  // Lookup logic when language+country codes are specified.
  switch (locale.languageCode) {
    case 'pt':
      {
        switch (locale.countryCode) {
          case 'BR':
            return FleatherLocalizationsPtBr();
        }
        break;
      }
  }

  // Lookup logic when only language code is specified.
  switch (locale.languageCode) {
    case 'pt':
      return FleatherLocalizationsPt();
    case 'de':
      return FleatherLocalizationsDe();
    case 'en':
      return FleatherLocalizationsEn();
    case 'fa':
      return FleatherLocalizationsFa();
    case 'fr':
      return FleatherLocalizationsFr();
    case 'ko':
      return FleatherLocalizationsKo();
    case 'nl':
      return FleatherLocalizationsNl();
  }

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