JsonIntl class
Main translation entry point. to get an instance of this class, call
JsonIntl.of(context)
Constructors
- JsonIntl(Locale locale, JsonIntlData _data)
-
Create a translation instance from a Locale and a JsonIntlData
const
Properties
Methods
-
count(
num value, Symbol key, {Map< String, dynamic> ? map, Map<String, MustacheFilter> ? filters, bool? strict}) → String -
Return the string corresponding to
key
, usingmap
andfilters
to replace the mustache-like variables.value
is a number that helps to choose the right translation variant according to the current language rules. Ifstrict
isfalse
the language rules are bent to always return the values for zero, one and two. -
gender(
JsonIntlGender gender, Symbol key, {Map< String, dynamic> ? map, Map<String, MustacheFilter> ? filters}) → String -
Return the string corresponding to
key
, usingmap
andfilters
to replace the mustache-like variables. gender helps to choose the right translation variant for the specified gender. -
get(
Symbol key, [Map< String, dynamic> ? map, Map<String, MustacheFilter> ? filters]) → String -
Return the string corresponding to
key
, usingmap
andfilters
to replace the mustache-like variables. -
later(
String text, [Map< String, dynamic> ? map, Map<String, MustacheFilter> ? filters]) → String -
Return the string using
map
andfilters
to replace the mustache-like variables. Useful to later translate the strings using proper keys. Intentionally marked as deprecated to generate a linter hint. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
translate(
Symbol key, {JsonIntlGender? gender, int? count, Map< String, dynamic> ? map, Map<String, MustacheFilter> ? filters, bool? strict}) → String - General purpose translation
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
of(
BuildContext context) → JsonIntl -
Get the nearest JsonIntl instance available within the
context