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

hashCode int
The hash code for this object.
no setterinherited
locale Locale
the locale this object can display
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

count(num value, Symbol key, {Map<String, dynamic>? map, Map<String, MustacheFilter>? filters, bool? strict}) String
Return the string corresponding to key, using map and filters to replace the mustache-like variables. 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.
gender(JsonIntlGender gender, Symbol key, {Map<String, dynamic>? map, Map<String, MustacheFilter>? filters}) String
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.
get(Symbol key, [Map<String, dynamic>? map, Map<String, MustacheFilter>? filters]) String
Return the string corresponding to key, using map and filters to replace the mustache-like variables.
later(String text, [Map<String, dynamic>? map, Map<String, MustacheFilter>? filters]) String
Return the string using map and filters 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

Constants

mock → const JsonIntl
Build a mocked translation object that will always return the key