LocaleSettingsExt<E extends BaseAppLocale<E, T> , T extends BaseTranslations<E, T> > extension
- on
-
- BaseLocaleSettings<
E, T>
- BaseLocaleSettings<
Properties
- currentLocale → E
-
Available on BaseLocaleSettings<
Gets the current locale.E, T> , provided by the LocaleSettingsExt extensionno setter - currentTranslations → T
-
Available on BaseLocaleSettings<
Gets the current translations. Falls back to the base locale if the current locale is not loaded.E, T> , provided by the LocaleSettingsExt extensionno setter -
supportedLocalesRaw
→ List<
String> -
Available on BaseLocaleSettings<
Gets supported locales in string format.E, T> , provided by the LocaleSettingsExt extensionno setter
Methods
-
getLocaleStream(
) → Stream< E> -
Available on BaseLocaleSettings<
Gets the broadcast stream to keep track of every locale change.E, T> , provided by the LocaleSettingsExt extension -
getTranslations(
E locale) → T -
Available on BaseLocaleSettings<
Gets the translations of the givenE, T> , provided by the LocaleSettingsExt extensionlocale. Falls back to the base locale if the given locale is not loaded. -
isLocaleLoaded(
E locale) → bool -
Available on BaseLocaleSettings<
Returns true if the translations of the givenE, T> , provided by the LocaleSettingsExt extensionlocaleare loaded. -
loadAllLocales(
) → Future< void> -
Available on BaseLocaleSettings<
Loads all locales.E, T> , provided by the LocaleSettingsExt extension -
loadAllLocalesSync(
) → void -
Available on BaseLocaleSettings<
Sync version of loadAllLocales.E, T> , provided by the LocaleSettingsExt extension -
loadLocale(
E locale) → Future< void> -
Available on BaseLocaleSettings<
Loads the translations of the givenE, T> , provided by the LocaleSettingsExt extensionlocaleif not already loaded. -
loadLocaleSync(
E locale) → void -
Available on BaseLocaleSettings<
Sync version of loadLocale.E, T> , provided by the LocaleSettingsExt extension -
overrideTranslations(
{required E locale, required FileType fileType, required String content}) → Future< void> -
Available on BaseLocaleSettings<
Overrides existing translations ofE, T> , provided by the LocaleSettingsExt extensionlocalewith new ones fromcontent. Thecontentshould be formatted and structured exactly the same way as the original files. -
overrideTranslationsFromMap(
{required E locale, required bool isFlatMap, required Map map}) → Future< void> -
Available on BaseLocaleSettings<
Overrides existing translations ofE, T> , provided by the LocaleSettingsExt extensionlocalewith new ones from themap. -
overrideTranslationsFromMapSync(
{required E locale, required bool isFlatMap, required Map map}) → void -
Available on BaseLocaleSettings<
Sync version of overrideTranslationsFromMap.E, T> , provided by the LocaleSettingsExt extension -
overrideTranslationsSync(
{required E locale, required FileType fileType, required String content}) → void -
Available on BaseLocaleSettings<
Sync version of overrideTranslations.E, T> , provided by the LocaleSettingsExt extension -
setLocale(
E locale, {bool? listenToDeviceLocale = false}) → Future< E> -
Available on BaseLocaleSettings<
Sets locale. Returns the locale which has been set.E, T> , provided by the LocaleSettingsExt extension -
setLocaleRaw(
String rawLocale, {bool? listenToDeviceLocale = false}) → Future< E> -
Available on BaseLocaleSettings<
Sets locale using string tag (e.g. en_US, de-DE, fr) Fallbacks to base locale. Returns the locale which has been set.E, T> , provided by the LocaleSettingsExt extension -
setLocaleRawSync(
String rawLocale, {bool? listenToDeviceLocale = false}) → E -
Available on BaseLocaleSettings<
Sync version of setLocaleRaw.E, T> , provided by the LocaleSettingsExt extension -
setLocaleSync(
E locale, {bool? listenToDeviceLocale = false}) → E -
Available on BaseLocaleSettings<
Sync version of setLocale.E, T> , provided by the LocaleSettingsExt extension -
setPluralResolver(
{String? language, E? locale, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) → Future< void> -
Available on BaseLocaleSettings<
Sets plural resolvers. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html See https://github.com/slang-i18n/slang/blob/main/slang/lib/src/api/plural_resolver_map.dart Either specifyE, T> , provided by the LocaleSettingsExt extensionlanguage, orlocale.localehas precedence. -
setPluralResolverSync(
{String? language, E? locale, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) → void -
Available on BaseLocaleSettings<
Sync version of setPluralResolver.E, T> , provided by the LocaleSettingsExt extension