Search code examples
iosxcodeios7localizationios-simulator

Xcode 5/iOS 7 - localization not working in simulator


I was following one of Ray Wenderlich's tutorials on localization but I can't seem to get it working.

I've set my project up for localization in English and French and I have a locaziable.strings file for each:

enter image description here

The French file has the correct (well as far as Google translate goes) French versions of my string:

enter image description here

I'm setting the strings by calling the correct key from the localizable.strings file:

 NSString* strTitle = [NSString stringWithFormat:NSLocalizedString(@"Title", Nil)];

And I have the simulator set to French (BTW: Whenever I do a language change the simulator crashes).

But it is not pulling from the correct localizable.strings file. It's still displaying in English:

enter image description here

Am I doing something wrong?


Solution

  • Maybe you have run the app at some time where the file Localizable.strings already existed but has not been localized yet. If this is the case, this unlocalized file still resides in the resources folder in the application bundle in the simulator (when you build an run a new version of your app in the simulator or in the device, unused files will not be deleted). This can lead to problems.

    Try to delete the app completely from the simulator and build an run again.