Starting with Android 7.0 (API level 24) user is able to set preferred languages on his device (source: LocaleList API). My problem is that my app does not respect this setting - it does not take the second language into account.
In Settings -> languages I have chosen my language preferences as:
1. Polish (preferred)
2. French
In Android app I have two languages supported (en as default, and fr):
values/strings.xml (English as default)
values-fr/strings.xml (French)
With this config, App is starting in English (which is default) while on my list of language preferences there is French (which is supported in my app, and should be used).
Why Android chooses English in this case? How to fix that?
Note: French language is set properly when I choose FR language as preferred in settings
EN strings.xml file sample:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE resources [<!ENTITY applicationName "app\'s name">]>
<resources>
<string name="application_name">&applicationName;</string>
<string name="dialog_ok">OK</string>
...
</resources>
FR strings.xml file sample:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE resources [<!ENTITY applicationName "french name">]>
<resources>
<string name="application_name">&applicationName;</string>
<string name="dialog_ok">Oui</string>
...
</resources>