Reputation: 2403
While developing an app, I tried use Android N multi-lingual support. As explained on developers site. It seems that it will automatically pick the resources using resource resolution mechanism.
But it doesn't seem to be working or could it be that I am missing something?
Here is the complete scenario :
Locales supported by app are placed in corresponding resource folder:
a. values (default) b. values-de c. values-es
So according to explanation provided on developers site it should pick locale from "values-de" directory. But it shows the default one.
Could someone give me an idea of what might be going wrong??
Upvotes: 7
Views: 2577
Reputation: 741
I was facing this issue and found out that removing alternative resources the app does not need resolves the issue.
android {
defaultConfig {
...
// Keeps language resources for only the locales specified below.
resConfigs "de", "es"
}
}
Check out Google Developer documentation here
Upvotes: 2
Reputation: 739
Ineteresting that this issue reproduces in sample project. But all works as intended if I remove "appcompat-v7" from compile dependencies. I don't know why for now and I'll keep digging.
UPDATE:
adding appcompact-v7 really fix the problem. watch this tutorial to understand why:
https://blog.egorand.me/a-curious-case-of-multiple-locales/
Upvotes: 5
Reputation: 301
You need to add android:configChanges="locale" in AndroidManifest.xml
Upvotes: -1