Wednesday, October 7, 2009

genstrings / copystrings

Setting up an iPhone project I came across some weird behviour with genstrings / copystrings commands.

In principle, genstrings is responsible for searching your source code for macro statements of the form NSLocalizedString(@"keyword", @"description") and will place an entry in a (UTF-16) text file called Localized.strings for each macro it discovers.

Now if you use this command to generate the file, add it to your project, localize it (by Right-clicking on the file, choosing "Get Info" and "Make Localizable") everything works great. If, however, you create that file manually (in my case using TextWrangler) the copystrings command will fail during the build process. I'm quite sure that this is somehow related to file permissions on Mac OS X but couldn't quite figure out what was going wrong. After all, the file permissions that you could see in Finder were the same either way.

If anybody else came across this and solved it (got manual creation of that file to work), let me know!

No comments:

Post a Comment