InMemoryI18n class

Pure-Dart I18nPort implementation: an in-memory table-backed translator with locale fallback chains and live switching.

Implemented types

Constructors

InMemoryI18n({required TranslationTable table, AppLocale? initialLocale})
Creates the translator over table; initialLocale defaults to the first table entry (or en).

Properties

hashCode int
The hash code for this object.
no setterinherited
locale AppLocale
The currently active locale.
getter/setter pairoverride-getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onLocaleChanged(void listener(AppLocale locale)) → void Function()
Subscribes to locale changes; returns the unsubscribe function.
override
setLocale(AppLocale next) Future<void>
Switches the active locale (loads its table if needed) and notifies listeners.
override
toString() String
A string representation of this object.
inherited
translate(String key, {Map<String, Object?> params = const {}, int? pluralCount}) ResolvedMessage
Translates key with params ({name} placeholders); pluralizes via pluralCount against key.one/key.other-style subkeys.
override

Operators

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