user1007522
user1007522

Reputation: 8118

NSLocalizedString gives other language then phone is in

My project base language is English. My simulator/phone is in English. The projects supports English, French, Dutch.

When the app starts for the first time the app is always in French even when the phone is in English.

When I debug and print out this line:

[NSLocale preferredLanguages][0];

It gives me the correct language namely English.

Does someone have an idea why this is?

Upvotes: 3

Views: 401

Answers (2)

Doro
Doro

Reputation: 2413

Please, check the following.

  1. Tap on your project_name -> edit scheme...
  2. Click on 'Options' tab
  3. Select on 'Application language' English (or whatever you need)

Just renaming localization files may cause some other bugs. Here is Apple guide about base localization:

https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/InternationalizingYourUserInterface/InternationalizingYourUserInterface.html

In order to remove base localization:

  1. click on your project in file inspector.
  2. Select 'Info' tap on yours project and deselect 'Use base Internationalization' on 'Localizations' section

Hope this helps.

Upvotes: 5

Bhanupriya
Bhanupriya

Reputation: 1202

I'm guessing Apple broke something with the simulator, because it works on real devices from Xcode 6.1. Check on real device

Upvotes: 0

Related Questions