-
-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
startLocale may not be used #430
Labels
bug
Something isn't working
Comments
+1 same issue. |
A workaround is to rename your own sharedpreferences key containing the expected locale to use ;) |
Yea, we did that, still annoying though :) |
gkhloptov
added a commit
to gkhloptov/easy_localization
that referenced
this issue
Dec 21, 2023
gkhloptov
added a commit
to gkhloptov/easy_localization
that referenced
this issue
Jun 3, 2024
gkhloptov
added a commit
to gkhloptov/easy_localization
that referenced
this issue
Jun 3, 2024
Ignore _savedLocale on start when saveLocale is false (aissat#430)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Depending on arguments passed to the
EasyLocalization
widget, thestartLocale
is not used.Problem encountered
The device locale is used as initial locale even if we supply another value in
startLocale
argument.Why is this happenning ?
In our case, this happens because we explicitly ask the widget not to handle save & restoration to handle it in our app, and we store the locale in SharedPreferences with the same key than this package.
Context to reproduce
To get into this usecase :
locale
key (I think its value is not important, but it must exists)EasyLocalisation
wiget:saveLocale
argument must be set to falsestartLocale
argument must be supplyoptionally the same as saved in
locale
key, but at least it must be different of the device locale otherwise the issue is not visibleSource code issue explanation
Source code of controller where the problem occurs annotated :
Potential resolution
IMHO, the
locale
SharedPreferences key is too common and can conflict with the application one, I think it should be more package specific likeeasy_localization_locale
.The text was updated successfully, but these errors were encountered: