Gettext class

Class for translating strings using gettext textdomains.

Constructors

Gettext({OnWarning? onWarning})

Properties

catalogs Map<String, Catalog>
final
domain String
Returns current domain
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
locale String
Returns current locale
getter/setter pair
onWarning OnWarning?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addLocale(Map<String, dynamic> data, {String domain = 'messages'}) → void
Adds new locale to gettext
addTranslations(String locale, Map<String, dynamic> translations, {String domain = 'messages'}) → void
Stores a set of translations in the set of gettext catalogs.
gettext(String msgid, {String? domain, String msgctxt = ''}) String
Translates a string using the default textdomain
ngettext(String msgid, String msgidPlural, int count, {String? domain, String msgctxt = ''}) String
Translates a plural string using the default textdomain
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setCatalog(String locale, Catalog catalog) → void
Load ready to use catalog for the locale
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

getLanguageCode(String locale) String
Returns the language code part of a locale