easy_localization library

Classes

AssetLoader
abstract class used to building your Custom AssetLoader Example:
EasyLocalization
EasyLocalization example:
RootBundleAssetLoader
default used is RootBundleAssetLoader which uses flutter's assetloader

Extensions

BuildContextEasyLocalizationExtension on BuildContext
BuildContext extension method for access to locale, supportedLocales, fallbackLocale, delegates and deleteSaveLocale()
LocaleToStringHelper on Locale
Easy Localization locale helper
StringToLocaleHelper on String
Easy Localization string locale helper
StringTranslateExtension on String
Strings extension method for access to tr() and plural() Example :
TextTranslateExtension on Text
Text widget extension method for access to tr() and plural() Example :

Functions

localeFromString(String localeString) Locale
Convert string locale localeString to Locale
localeToString(Locale locale, {String separator = '_'}) String
Convert locale to Srting with custom separator
plural(String key, num value, {List<String>? args, Map<String, String>? namedArgs, String? name}) String
function translate with pluralization key Localization key value Number value for pluralization BuildContext The location in the tree where this widget builds args List of localized strings. Replaces {} left to right namedArgs Map of localized strings. Replaces the name keys {key_name} according to its name name Name of number value. Replaces {$name} to value format Formats a numeric value using a NumberFormat class
tr(String key, {List<String>? args, Map<String, String>? namedArgs, String? gender}) String
Main function for translate your language keys key Localization key BuildContext The location in the tree where this widget builds args List of localized strings. Replaces {} left to right namedArgs Map of localized strings. Replaces the name keys {key_name} according to its name gender Gender switcher. Changes the localized string based on gender string