Search code examples
iosios-simulatornslocalizedstring

Localizable.strings doesn't work at all anymore


I was adding the localization feature on a branch named 'Localization'. However, I had to submit a hot fix, so I changed branches, did the fix and returned back to the 'Localization' branch. Now NSLocalizableStrings() doesn't work at all anymore, for any language; it only displays the keys.

I've seen this question and have tried all of the suggestions listed there but none has worked for me.

  • I've made sure the file name is correct
  • I've used plutil -lint to ensure the Localizable.strings files are valid
  • I've Reset Content and Settings of the simulator
  • I've tried cleaning the project and reinstalling the app on the simulator
  • I've tried running on an actual device (same issue appears on the device)
  • I've tried restarting Xcode
  • I've tried restarting my machine

Not a single one of these things worked. Does anyone have any ideas? It was all working fine a few minutes ago


Solution

  • Here are the steps that worked for me:

    1. Uninstall the application from Simulator.

    2. Clean the project.

    3. Make some sort of change to each of the Localizable.strings files in the project (this is to invalidate some kind of cache, I suppose). Just an extra space worked for me.

    4. Run the application.