Translator class abstract

Translator base class.

Implementers

Constructors

Translator({TranslatorLogger? logger, TranslatorCache? cache, bool translateBlocksInParallel = false, int maxParallelTranslations = 0})

Properties

cache TranslatorCache?
Optional Translator cache.
final
hashCode int
The hash code for this object.
no setterinherited
logger TranslatorLogger?
Optional logger.
final
maxBlockLength int
Returns the maximum length of a block. See splitBlocks.
no setter
maxParallelTranslations int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
translateBlocksInParallel bool
final

Methods

cacheEntries(Map<String, String> entries, Map<String, String> translations, IntlLocale fromLocale, IntlLocale toLocale) FutureOr<List<bool>?>
Cache translated entries (if cache is provided).
getCachedEntries(Map<String, String> entries, IntlLocale fromLocale, IntlLocale toLocale) FutureOr<Map<String, String>?>
Returns the cached translations for entries (if cache is provided).
log(Object o) → void
Logs o calling logger.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveLocaleName(IntlLocale locale) String
Resolves locale to the language name.
splitBlocks(List<MapEntry<String, String>> entries) List<List<MapEntry<String, String>>>
Split entries into blocks.
toString() String
A string representation of this object.
inherited
translate(Map<String, String> entries, IntlLocale fromLocale, IntlLocale toLocale, {bool confirm = true}) FutureOr<Map<String, String>?>
Translates entries to locale.
translateBlock(Map<String, String> entries, IntlLocale fromLocale, IntlLocale toLocale, String fromLanguage, String toLanguage, bool confirm) FutureOr<Map<String, String>?>
Translates an entries block. Called by translate.

Operators

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