resConfigs attribute does not work as I expected, Reads from a different language, Not the device language

Viewed 42

My app support two languages (English and Arabic languages)

values -> strings.xml (Contains English texts)
values-ar -> strings.xml (Contains Arabic texts)

I added the FirebaseUI library inside my app and I need to use English and Arabic languages only from that library and exclude other languages. Here is what I did

build.gradle

android {
    ...
    defaultConfig {
        ...
        resConfigs "ar"
    }
}

Here is the result after a few tests

  1. If the device language was the Arabic language, The whole app will read the texts from values-ar -> strings.xml (That is okay)
  2. If the device language was the English language, The whole app will read the texts from values -> strings.xml (That is okay)
  3. If the device language was the Spanish or French language, The whole app will read the texts from values -> strings.xml and sometimes will read from values-ar -> strings.xml (That is not okay), The problem happens when changing the language from the settings

This is so confusing, How can I solve the problem?

0 Answers
Related