translate method
String
translate(
- Symbol key, {
- JsonIntlGender? gender,
- int? count,
- Map<
String, dynamic> ? map, - Map<
String, MustacheFilter> ? filters, - bool? strict,
General purpose translation
Return the string corresponding to key
, using map
and filters
to
replace the mustache-like variables.
gender
helps to choose the right translation variant for the specified
gender.
value
is a number that helps to choose the right translation variant
according to the current language rules.
If strict
is false
the language rules are bent to always return the
values for zero, one and two.
Implementation
String translate(
Symbol key, {
JsonIntlGender? gender,
int? count,
Map<String, dynamic>? map,
Map<String, MustacheFilter>? filters,
bool? strict,
}) {
if (map == null && count == null && gender == null) {
return _data.translate(key);
}
return _data.translateWithMap(
key,
map: map,
filters: filters,
count: count,
gender: gender,
locale: locale.toLanguageTag(),
strict: strict,
);
}