easy_localization library

Classes

AssetLoader
abstract class used to building your Custom AssetLoader Example:
Bidi
This provides utility methods for working with bidirectional text. All of the methods are static, and are organized into a class primarily to group them together for documentation and discoverability.
BidiFormatter
Bidi stands for Bi-directional text. According to Wikipedia: Bi-directional text is text containing text in both text directionalities, both right-to-left (RTL) and left-to-right (LTR). It generally involves text containing different types of alphabets, but may also refer to boustrophedon, which is changing text directionality in each row.
DateFormat
DateFormat is for formatting and parsing dates in a locale-sensitive manner.
EasyLocalization
EasyLocalization example:
Intl
The Intl class provides a common entry point for internationalization related tasks. An Intl instance can be created for a particular locale and used to create a date format via anIntl.date(). Static methods on this class are also used in message formatting.
MicroMoney
Used primarily for currency formatting, this number-like class stores millionths of a currency unit, typically as an Int64.
NumberFormat
Provides the ability to format a number in a locale-specific way.
RootBundleAssetLoader
default used is RootBundleAssetLoader which uses flutter's assetloader
TextDirection
Represents directionality of text.

Extensions

BuildContextEasyLocalizationExtension on BuildContext
BuildContext extension method for access to locale, supportedLocales, fallbackLocale, delegates and deleteSaveLocale()
LocaleToStringHelper on Locale
Easy Localization locale helper
MapExtension on Map<K, dynamic>
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, BuildContext? context, Map<String, String>? namedArgs, String? name, NumberFormat? format}) 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
toBeginningOfSentenceCase(String? input, [String? locale]) String?
Convert a string to beginning of sentence case, in a way appropriate to the locale.
tr(String key, {BuildContext? context, 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
trExists(String key) bool