registerTranslations method
Register a feature's translation configuration
This should be called during feature initialization. The plugin will:
- Initialize the feature's translations with the current locale
- Register the callback for future locale changes
Implementation
void registerTranslations(TranslationRegistration registration) {
_registrations.add(registration);
vyuh.log.info(
'LocalePlugin: Registered translations for "${registration.name}"');
// Initialize with current locale (async to support deferred loading)
Future.microtask(() async {
try {
await registration.onLocaleChange(currentLocale.value);
} catch (e) {
vyuh.log.error(
'LocalePlugin: Error initializing "${registration.name}" translations: $e',
);
}
});
}