1

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

Community
  • 1
  • 1
W.K.S
  • 9,787
  • 15
  • 75
  • 122

3 Answers3

2

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.

W.K.S
  • 9,787
  • 15
  • 75
  • 122
1
  1. Add your Localised file or Strings
  2. Make sure your language code is correct
  3. Uninstall your App in simulator or device
  4. Clean build folder (cmd+shift+k)
  5. Now run the Application

Now working...

0

Try to:

  1. You said you did checked names, but you wrote "localisable.string", should be "Localizable.strings"
  2. Clean (Shift+cmd+k)
  3. Switch from .string file to .xib or storyboard and back
  4. See if the modified strings still there
  5. Check for missing ; in the storyboard strings (as it doesn't raise errors at compile time)
Federico Picci
  • 1,105
  • 10
  • 17
  • Sorry, I meant to write `Localizable.strings` in the question. I followed those steps, still no luck – W.K.S May 17 '17 at 09:11