Nic Hubbard
Nic Hubbard

Reputation: 42139

iPhone: Update Localizable.strings files using genstrings?

I have generated my strings file correctly using genstrings. I have changed the localized strings for my different languages. Now, I have added a few more NSLocalizedString() occurrences and I want to generate those into all of my localized strings files.

But, running genstrings again does not seem to update my strings files. Am I doing something wrong?

Upvotes: 14

Views: 7886

Answers (2)

cynistersix
cynistersix

Reputation: 1215

the -a option should append new values to your translations

Upvotes: -2

Terry Blanchard
Terry Blanchard

Reputation: 449

Usually this is because you've got genstrings looking in the wrong folder, or in the wrong files. I had a problem where it wasn't picking up all of my strings, and I realized it was only searching for *.m files (not *.mm) and it wasn't parsing the files in my Classes folder. A small change fixed that:

genstrings -o Classes/en.lproj Classes/*.{m,mm}

The first parameter tells genstrings where I want the .strings file.

  • -o Classes/en.lprog

The second parameter tells genstrings where to look. Remember I'm running genstrings from the project root, so I needed to specify Classes/.m, or more specifically Classes/.{m,mm} so it would parse .m and .mm files.

Upvotes: 10

Related Questions