setLocale method

  1. @override
void setLocale(
  1. String locale
)
override

Sets the current locale.

If the locale is not available, it will fall back to the fallback locale.

Implementation

@override
void setLocale(String locale) {
  _currentLocale = locale;
  if (!_loadedLocales.contains(locale)) {
    _loadLocale(locale);
  }
  if (!_translations.containsKey(locale)) {
    _currentLocale = _fallbackLocale;
  }
}