i18n_extension library

Extensions

Localization on String

Functions

convertToIntegerModifier(Object? modifierObj) int
See rules stated in localizePlural's documentation.
localize(String key, ITranslations translations, {String? locale}) String
To localize a translatable string, pass its key and the translations object.
localizeAllVersions(String key, ITranslations translations, {String? locale}) Map<String?, String>
Returns a map of all translated strings, where modifiers are the keys. In special, the unversioned text is indexed with a null key.
localizeFill(String text, List<Object> params) String
localizePlural(Object? modifier, String key, ITranslations translations, {String? locale}) String
Returns the translated version for the plural modifier. After getting the version, substring %d will be replaced with the modifier.
localizeVersion(Object modifier, String key, ITranslations translations, {String? locale}) String
Return the localized string, according to key and modifier.
recordKey(String key) String
This simply records the given key as a missing translation with unknown locale.