TranslationRegistration class
Registration for feature-specific translations
Features can register their translation with the LocalePlugin. When using slang, translations are managed globally through LocaleSettings, so no provider wrapper is needed.
Example:
localePlugin.registerTranslations(
TranslationRegistration(
name: 'my_feature',
onLocaleChange: (locale) async {
final appLocale = _convertToAppLocale(locale);
await FeatureLocaleSettings.setLocale(appLocale);
},
),
);
Constructors
-
TranslationRegistration({required String name, required Future<
void> onLocaleChange(Locale locale)}) -
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
Name of the translation system (for debugging)
final
-
onLocaleChange
→ Future<
void> Function(Locale locale) -
Callback when locale changes (async to support deferred loading)
final
- 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
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited