Xcode Localization Not Working?

2019-06-24 01:51发布

问题:

I am trying to add a new localization for my app for Mac OS X (Mountain Lion). I added the appropriate localizations to the project info panel and made all the .xib files localized. I also added and translated the .strings file and replaced the .xib files with the translated strings file. Then everything seemed to be working, and the interface builder showed appropriate translations for each localization xib file. However, when I actually run the app, it is shown in English, although the default language for my system is not English. I also have a Localizable.strings file for some of the labels, and for those that I used NSLocalizedString works fine. I'm not sure what I am missing here?

Thanks in advance.

回答1:

  1. Perform build clean ( Command-Option-Shift-K)
  2. Remove the app from simulator/device
  3. Launch the app


回答2:

Check that you marked Target Membership of your Target. I had the same problem, because I had add my string manually.

Look at the image.