fast_i18n v5.9.0
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.