Android generating wrong language code for Indonesia?

Viewed 2296

This is happening on all of the devices we have in Indonesia.

The country codes are correct, also the display language and ISO3 seem correct:

Locale.getDefault().getISO3Country()     // "IDN"
Locale.getDefault().getDisplayCountry()  // "Indonesia"
Locale.getDefault().getCountry()         // "ID"
Locale.getDefault().getISO3Language()    // "ind"
Locale.getDefault().getDisplayLanguage() // "Bahasa Indonesia"

But the normal language code is wrong, should be "id" instead of "in". And then android is also generating the wrong language_COUNTRY identifier, should be "id_ID" instead of "in_ID":

Locale.getDefault().getLanguage()        // "in"
Locale.getDefault().toString()           // "in_ID"

Is this a known problem? What can we do about it?

cyanide suggests just overwriting the locale, but what about the devices who really need to use "in" and not "id", it would be the wrong one for them then?

3 Answers

I have a same experience and I found a reference in Android Developer Site

If you want to change old language code("he", "yi", and "id") to new one("iw", "ji", and "in"), you just use this API below

//kotlin
Locale.getDefault().toLanguageTag()
Related