Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble with language localization in Android. Application doesn't load necessary resourses from strings.xml

I have an application which can be localized to many languages. But I have one big trouble. I have default file values/strings.xml where I store string in English by default and I have folder values-uk/strings.xml (for Ukrainian localization). I am saving the selected localization in SharedPreferences. The trouble is when the application starts without any selected language preference (but the system language of device is Ukrainian, I checked) my app must load Ukrainian strings from values-uk/strings.xml, but it loads English values from values/strings.xml. Can anyone explain me why this happens and how can I solve this problem. Thank you very much!

like image 347
bukka.wh Avatar asked Sep 20 '25 14:09

bukka.wh


1 Answers

Also always check your build.gradle (app) android/defaultConfig, if there set resConfigs("en", "de", "ru"...). If yes only listed resources will leave in the project.

like image 184
Daniel Avatar answered Sep 22 '25 03:09

Daniel