localizeVersion function
Use the localizeVersion method to localize a "translatable string" to the given locale
.
You must provide the key
(which is usually the string you want to translate),
a modifier
, and the translations
object which holds the translations.
You may use an object of any type as the modifier
, but it will do a toString()
in it and use resulting String. So, make sure your object has a suitable
string representation.
If locale
is not provided (it's null
), the method will use the default locale
in DefaultLocale.locale
(which may be set with DefaultLocale.set
.
If both locale
and DefaultLocale.locale
are not provided, it defaults to 'en_US'.
Implementation
String localizeVersion(
Object modifier,
Object? key,
Translations translations, {
String? locale,
}) =>
core.localizeVersion(modifier, key, translations, locale: locale ?? I18n.localeStr);