localison library

Classes

Localison
A utility class to load localization texts from a JSON resource file.
LocalisonByLanguageDelegate
A LocalizationsDelegate that loads a JSON file from local resources directory for a supported language derived from a list of Locales.
LocalisonDelegate
A LocalizationsDelegate that loads a JSON file from local resources directory for a list of supported Locales.

Extensions

ExtendedLocalisonGender
Extension functions for LocalisonGender class.
ExtendedLocalisonPlural
Extension functions for LocalisonPlural class.

Properties

defaultQuantities Map<LocalisonQuantity, int>
Default values for quantities defined in LocalisonQuantity.
final
pluralRules Map<String, PluralRule>
Selected Plural rules by locale.
final

Functions

localeHasPluralRules(String locale) bool
Do we have plural rules specific to locale
startRuleEvaluation(num howMany, [int precision = 0]) → void
This must be called before evaluating a new rule, because we're using library-global state to both keep the rules terse and minimize space.

Enums

LocalisonGender
Gender types that Localison supports. If you'd like to see more types, please submit a pr.
LocalisonPlural
Plural rules according to Unicode plural rules: https://www.unicode.org/cldr/charts/34/supplemental/language_plural_rules.html
LocalisonQuantity
Plural rules when dealing with quantities.

Typedefs

PluralRule = LocalisonPlural Function()