slang-i18n / slang

Type-safe i18n for Dart and Flutter
https://pub.dev/packages/slang
MIT License
419 stars 36 forks source link

How to make a language switcher? #221

Open simplenotezy opened 4 weeks ago

simplenotezy commented 4 weeks ago

When calling LocaleSettings.setLocale(locale); nothing happens unless I click "Hot reload".

How can I have the views update when changing language?

simplenotezy commented 4 weeks ago

Found: https://github.com/slang-i18n/slang/issues/37

The solution is to use final t = Translations.of(context); instead. This should probably be documented.

Tienisto commented 3 weeks ago

Hi, this is already documented in https://pub.dev/packages/slang#-changing-locale