Skip to content

fast_i18n v5.9.0

Compare
Choose a tag to compare
@Tienisto Tienisto released this 19 Jan 20:23
2a2c3b0

Dependency Injection (optional)

Plural resolvers are now part of the translation class.

Meaning, you can now build your own instance without relying on LocaleSettings or any other side effects.

This is entirely optional! You can still use the included LocaleSettings solution.

// riverpod example
final english = AppLocale.en.build(cardinalResolver: myEnResolver);
final german = AppLocale.de.build(cardinalResolver: myDeResolver);
final translationProvider = StateProvider<StringsEn>((ref) => german);

// access the current instance
final t = ref.watch(translationProvider);
String a = t.welcome.title;

For more information, checkout the full article.