Skip to content
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

Improved localization handling on screen turn (might fix issue #125) #128

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Chriz76
Copy link

@Chriz76 Chriz76 commented Jun 24, 2019

  • in some activities the code for setting the locale was missing and therefore a simple turn of the device switched to localized texts even if localized resources were disabled
  • for all other activities there was the problem that the locale was set only in onCreate but in some special cases the config is reset but only onResume gets called (e.g. when turning the device, hitting the home button, turning the device back and then switching to AT again). Setting it only in onResume would be too late for the regular cases. The code is almost a noop if there is no change to be done so it seems ok to call it twice.
  • created two baseclasses for activities to encapsulate the logic and increase the chance that a new activity will be based on that classes and the code will not be forgotten
  • might fix issue Localized resources showing even when disabled #125 "Localized resources showing even when disabled"
  • ways of working solutions for setting the locale differ from API level to API level (see https://proandroiddev.com/change-language-programmatically-at-runtime-on-android-5e6bc15c758)
  • tested on android Pie and Marshmallow

…#125)

- in some activities the code for setting the locale was missing and therefore a simple turn of the device switched to localized texts even if localized resources were disabled
- for all other activities there was the problem that the locale was set only in onCreate but in some special cases the config is reset but only onResume gets called (e.g. when turning the device, hitting the home button, turning the device back and then switching to AT again). Setting it only in onResume would be too late for the regular cases. The code is almost a noop if there is no change to be done so it seems ok to call it twice.
- created two baseclasses for activities to encapsulate the logic and increase the chance that a new activity will be based on that classes and the code will not be forgotten
- might fix issue Zukero#125 "Localized resources showing even when disabled"
- ways of working solutions for setting the locale differ from API level to API level (see https://proandroiddev.com/change-language-programmatically-at-runtime-on-android-5e6bc15c758)
- tested on android Pie and Marshmallow
…oblems on some activities where still the localized content was shown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant