parseAppLocale method

E parseAppLocale(
  1. BaseAppLocale<BaseAppLocale, BaseTranslations> locale
)

Gets the E type of locale.

locale may have a locale which is unsupported by E. In this case, the base locale will be returned.

Implementation

E parseAppLocale(BaseAppLocale locale) {
  if (locale is E) {
    return locale; // take it directly
  }

  return parseLocaleParts(
    languageCode: locale.languageCode,
    scriptCode: locale.scriptCode,
    countryCode: locale.countryCode,
  );
}