YarikSOffice / lingver

Manage your application locale and language.
https://proandroiddev.com/change-language-programmatically-at-runtime-on-android-5e6bc15c758
MIT License
512 stars 61 forks source link

Android 5.1.1 language change not working #25

Closed lurbenk closed 4 years ago

lurbenk commented 4 years ago

Hi, i implemented language change on my app, everything works fine but i received report about problem on Android 5.1, on this version is language change do nothing, just refresh activity and whole content remain in default language.

Does anybody face similar issue ? or this version and lower are not supported ? Thanks upfront for any help :)

YarikSOffice commented 4 years ago

@lurbenk The library supports all android versions.

Could you describe your issue in more details?

Also, a sample project reproducing the issue is highly appreciated.

lurbenk commented 4 years ago

as i checked now app is still in english by default also after lang change. same problem also appears on Android 6.0 (tested just on emulator)

YarikSOffice commented 4 years ago

Btw, if you use multiple activities, you have to restart all of them (the entire back stack).

Besides that, I don't see any issues here. Could you provide a sample project, so I can investigate the issue and fix it asap.

lurbenk commented 4 years ago

hi, i tried to extract logic related to language change : https://github.com/lurbenk/languageSample basicly textView in left top croner works as switcher. Also this test app remain in english all time

YarikSOffice commented 4 years ago

Okay, I've checked the sample app.

As far as I see, the cause of the issue is a wrong locale resolution. Android is not able to link the sk locale and the string resources inside values-sk-rSK folder. However, it works on Android 7 and above due to the new locale resolution strategy.

You can put your string resources inside values-sk folder to solve the issue. If it's not an option for you for some reason, then you have to find another workaround.

lurbenk commented 4 years ago

what a terrible mistake on my side, sorry for bothering you with this issue. But thank you very much for help and very fast response :) wish to have such a great support and help everywhere :)

YarikSOffice commented 4 years ago

@lurbenk you are welcome :)