localizely / flutter-intl-intellij

This Android Studio & IntelliJ plugin generates boilerplate code for localization of Flutter apps with official Dart Intl library
MIT License
129 stars 4 forks source link

LicensePage widget forces phone language to English #31

Open masewo opened 4 years ago

masewo commented 4 years ago

If I visit a LicensePage via showLicensePage and turn back to my app, then the app switched from the previous set language to english.

According to pull request https://github.com/flutter/website/pull/3013 we should not override the Intl.defaultLocale anymore. Instead we shall add the locale to Intl.message.

Whoever needs or wants to modify the l10n.dart file by hand (e. g. before building the app in a pipeline), here the steps I do:

sed -i -e "s/^.*Intl.defaultLocale = localeName;.*$//g" lib/generated/l10n.dart
sed -i -e "s/S.current = S();/S.current = S(localeName);/g" lib/generated/l10n.dart
sed -i -e "s/S();/S(this.localeName); String localeName;/" lib/generated/l10n.dart
sed -i -e "s/args: \[\],/args: \[\], locale: localeName/g" lib/generated/l10n.dart
aleksakrstic commented 4 years ago

Hi @masewo Yes, we already plan this for one of upcoming updates, as discussed in https://github.com/localizely/flutter-intl-intellij/issues/26