Xcode 5/iOS 7 - localization not working in simulator

23,147

Solution 1

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.

Solution 2

If you are using xcode 6.1.1 and iOS sdk 8.1,try this workaround.

It seems localization does not work with xCode 6.1 and 8.1 simulator. Workaround: Go to "edit schemes" >> "Run" (side bar) >> "Options" tab >> "Application Language" Select the language you wish to run the app on the simulator. I got this workaround from Workaround by natanavra Thanks to him.

However I read on developer forum,that it is working in 6.2 beta version of Xcode. Hope it do.

Solution 3

I have experienced similar issues (IB localization in my case) on device. So general answer would be

Device - Uninstall app and clean project by Shift+CMD+K

Simulator - Go iOS simulator > Reset Content and Settings and clean project by Shift+CMD+K

These problems are really annoying. Along with poor ability to update localized strings is localization one of the biggest drawback of iOS development.

Solution 4

Another problem that could cause localization not work is the encoding of the strings file. Localizable.strings's encoding must be UTF-16. The default encoding of text file in xcode is UTF-8, that cause me spending a whole day to check why the localization not work.

Solution 5

In Xcode 6.0 and later, Localization not work by changing language in Simulator not working.

You have to edit scheme before running your application.

Go to Edit Scheme -> Run -> Options, change language here.

Now, Run Your Application. It will Work.

For more details, check this answer : Changing language on iOS 8.1 simulator does not work

Share:
23,147
PruitIgoe
Author by

PruitIgoe

I have been a soldier, a journalist, an archaeologist, a graphic/web designer and am now programmer, working in web front end, building desktop applications and mobile app development. I prefer to work in objective-c or if it is to be a cross-platform app then Appcelerator's Titanium.

Updated on December 30, 2020

Comments

  • PruitIgoe
    PruitIgoe over 3 years

    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?