How are you using these values? In what way is it causing problems for your app?
It's certainly no surprise that language and locale country are independent of each other. I agree with you that it's surprising that the 2nd and 4th cases differ.
When you changed the region to España, did that perhaps automatically change the language to plain Español (not the Latin American variant)?
Oh sorry, I forgot to mention about the case for us. We have to use the country and language codes on our request parameters for changing localization strings on our app and for making a translation automatically. This app has to know the device language for it at launch and we translate sth user writes to any language.
Yes they are independent, one of them gives us chosen languages for the user but the other is for device language. With this bug, on iOS devices, main languages can be chosen as a device language but sub-languages cant be chosen like that. They can be get from preferred languages. But yes 2nd - 4th cases have buggy case. They somehow match or correct language and its country's language together.
When I change country to Espana, device language doesnt change to Espanol, it keeps previous device language. If you change to Espanol, it is same with the 3rd case, no problem.
Do we have to always use countryCode, languageCode for using them on localization of all texts on our app? If we want to customize languages with more one, I think we can use preferred one? But again "es-419" case is a little strange thing.
Maybe it's different on iOS — I don't do iOS development — but the locale generally does not indicate the "device language" or anything about language at all. It indicates which conventions to use for formatting numbers, dates, currency, etc.
I don't understand what distinction you're trying to make between the user's language(s) and the "device language". I don't know what the device language even is (but I'm willing to confess ignorance). Why do you care for your app? Why can't you just use the user's language?
the locale generally does not indicate the "device language" or anything about language at all.
Right. If you want to tell your server to return strings that match the language that your app is running in, you should get the
preferredLocalizationsproperty of the main bundle.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"