Hi
I am using Xcode 9.4 and testing our iOS application on real device (iOS 11.4 installed) for localizations. Our device region is Turkey and device language is Turkish. On this case;
[NSLocale preferredLanguages] -> tr-TR
[NSLocale currentLocale].countryCode -> TR
[NSLocale currentLocale].languageCode -> tr
When I change the language to Espanol LatinoAmerica, it becomes;
[NSLocale preferredLanguages] -> es-419, tr-TR
[NSLocale currentLocale].countryCode -> TR
[NSLocale currentLocale].languageCode -> es
And then I change the region of the device to Espanol, it becomes;
[NSLocale preferredLanguages] -> es-ES, tr-TR
[NSLocale currentLocale].countryCode -> ES
[NSLocale currentLocale].languageCode -> es
After this strange inconsistency, I change the region to Turkey again, it becomes weirdly;
[NSLocale preferredLanguages] -> es-TR, tr-TR
[NSLocale currentLocale].countryCode -> TR
[NSLocale currentLocale].languageCode -> es
I think there is a bug for preferredLanguages and 2nd or 4th case must have same results, but not. It creates unstable cases for the application. How can I pass this bug? Do I have to look countryCode and languageCode instead of preferredLanguages? Looking them save us from the buggy cases (on different regions or languages) or not?
On iOS 10+ devices the problem is the same also.
Thanks