localizely / flutter-intl-plugin-sample-app

Flutter app localization sample with Flutter Intl extension for VS Code, Android Studio / IntelliJ
MIT License
79 stars 10 forks source link

S.of(context).localeName not getting updated. #5

Closed ramin-deriv closed 3 years ago

ramin-deriv commented 3 years ago

After changing app locale using S.load(Locale('de', 'DE'));, the S.of(context).localeName still shows en.

Even after setState and when rebuilding is done. It's not updated.

Update: Also using Localization.localOf(context).languageCode returns en.

aleksakrstic commented 3 years ago

Hi @raminvakili-fs If you want to get currently selected locale, you should do it with Intl.getCurrentLocale(). You can find this and other usage info in VS Code extension and Android Studio plugin docs.