iOS 8.1 Simulator Localization Broken (Nslocalizedstring)

Settings.bundle Localization Broken

As I suspected, my installation of Xcode was broken.

After reinstalling Xcode by updating to 9.3.1, adding a settings bundle results in the expecyed behaviour:

Sample Image

Not the most common scenario, I know, but I hope this answer helps someone in the same situation someday.

iOS: Localizable.strings doesn't work

I found out what the issue is:

AppDelegate's application:didFinishLoadingWithOptions: contained this snippet of code

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:@[@"en"] forKey:@"AppleLanguages"];
[defaults synchronize];

which forces NSLocalizedString() to return English values.

The project was outsourced and I had no idea that the snippet was there.

iOS localization is broken with the upgrade iOs 9 + Xcode 7

Solved, the "problem" was the key "Localization native development region" in the info.plist file. It was setted to Italy, so when the app was running in a device with the Italian language as default it was showing the Base localization version of the strings (the English version).
Changing the value to United States solved the issue.



Related Topics



Leave a reply



Submit