LocaleSettingsExt<E extends BaseAppLocale<T> , T extends BaseTranslations> extension
- on
-
- BaseLocaleSettings<
E, T>
- BaseLocaleSettings<
Properties
- currentLocale → E
-
Gets current locale.
no setter
- currentTranslations → T
-
Gets current translations
no setter
-
supportedLocalesRaw
→ List<
String> -
Gets supported locales in string format.
no setter
Methods
-
getLocaleStream(
) → Stream< E> - Gets the broadcast stream to keep track of every locale change.
-
setLocale(
E locale) → E - Sets locale, but do not change potential TranslationProvider's state Useful when you are in a pure Dart environment (without Flutter) This will be overwritten when using with flutter.
-
setLocaleRaw(
String rawLocale) → E - Sets locale using string tag (e.g. en_US, de-DE, fr) Fallbacks to base locale. Returns the locale which has been set.
-
setPluralResolver(
{String? language, E? locale, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) → void -
Sets plural resolvers.
See https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/language_plural_rules.html
See https://github.com/Tienisto/slang/blob/master/slang/lib/api/plural_resolver_map.dart
Either specify
language
, orlocale
.locale
has precedence.