Our iOS project has localized strings for both "Spanish" (es.lproj) and "Spanish (Latin America)" (es-419.lproj), as created from within Xcode.
However, on the iPhone (U.S., latest iOS 7), the only language options for Spanish are "Español" and "Español (México)", no "Latin America". And when you select "Español (México)", it uses the "Spanish" strings from our app, not the "Spanish (Latin America)" strings, as one would expect.
On further investigation, [[NSBundle mainBundle] preferredLocalizations]
returns @[@"es"]
. This is even though [[NSBundle mainBundle] localizations]
returns an array containing both "es" and "es-419".
However, [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"]
returns an array containing "es-MX".
And then the following expression:
[NSBundle preferredLocalizationsFromArray:@[@"es-419", @"es"]
forPreferences:@[@"es-MX"]]
returns @[@"es"]
.
Why would Xcode give us "Spanish (Latin America)" localization, when it is not used when you actually select the only Latin American Spanish option on the phone?