-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
Fix language changing issues #292
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @hegocre for this as well as your Spanish and Catalan translations 😃
Calling applyOverrideConfiguration
itself fixed the issue on the device I was testing without changing the language code.
Do not see this affecting existing users too but will wait for @spuday90 to review this before merging.
Thank you!!
@adeekshith You are welcome! I also noticed that some devices neee none, some need one and others need both patches to work correctly. The problem I see here is that existing users will need to set their language again. Maybe changing PreferencesManager.java to remove the r before creating the locale would be lesw intrusive, but would require you to keep adding the r to new locales. If you prefer it that way I can change this on my pull request before merging. Cheers! |
Oh I was thinking we were saving the key (
That should do but how about this solution:
|
You're welcome! Amazing work with this app! |
* Russian translations by [crlf](https //translate.watomatic.app/profile/crlf) (#289) * Macedonian translations by [Soma Dima](https //translate.watomatic.app/profile/somadima) (#289) * Spanish translations by [Diego Muñoz](https //translate.watomatic.app/profile/dmzu) and [Benet R. i Camps](https //translate.watomatic.app/profile/bennybeat) (#289) * Finnish translations by [Rynach](https //translate.watomatic.app/profile/rynach) (#289) * Tamil translations by [HarishBeWe](https //translate.watomatic.app/profile/harishbewe) (#289) * New Polish translations by [Patryk Prawada](https //translate.watomatic.app/profile/gempxplay) (#289) * German translations by [daengi](https //translate.watomatic.app/profile/daengi) (#289) * Basque translations by [Joxe Rojas](https //translate.watomatic.app/profile/joxerg) (#289) * Turkish translations by [Tansel Karakaya](https //translate.watomatic.app/profile/karakaya.tansel) (#289) * Catalan translations by [Benet R. i Camps](https //translate.watomatic.app/profile/bennybeat) (#289) * Prevent Watomatic service from getting killed in the background on some devices by @spuday90 (#291) * Fix language change setting does not work on first click by @hegocre (#298) * Fixed an issue where language switching is not working on all devices by @hegocre (#292) * Show settings button in main screen without hiding in the menu (#294)
Fix for locale changing issues, possible fix #270, tested on Android Emulator API 21 (previously not working, now it does), as well as API 29 and 30 on physical devices, both working.
When creating locales, region code must be a 2 alpha character string as explained here, I imagine the r added on resource folder is an abbreviation for region and should not be used when creating Locales in code.
Also, a bug on AndroidX compat library causes the locale to be overridden to default on API versions 21 to 25 because of DayNight compatibility, so applyOverrideConfiguration must be called with the new context created.