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;initialLocaledefaults to the first table entry (oren).
Properties
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
keywithparams({name}placeholders); pluralizes viapluralCountagainstkey.one/key.other-style subkeys.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited