Re: simple genstrings question
Re: simple genstrings question
- Subject: Re: simple genstrings question
- From: Ali Ozer <email@hidden>
- Date: Wed, 19 Sep 2001 09:11:11 -0700
>
Is there a simple way to take a whole folder of source and feed it to
>
genstrings? I'm sure there must be some unix command to pipe the output
>
of ls or something. It would be a pain to have to manually type in
>
every file name.
You could do something like
genstrings -o outputfolder *.[mch] */*.[mch]
You typically want to feed all the source files through genstrings
together; if you can't do this, feed source files that can contain
references to the same tables together. If you run genstrings which each
file one at a time, and one file creates Localizable.strings, the other
will overwrite it.
>
Also, what is the best way to have string constants using
>
NSLocalizedString. I was going to put them in a .h file, but it looks
>
like genstrings only works with .c or .m? Is that true?
genstrings will process .h files just fine; your example does work.
What genstrings can't do is references to variables, for instance
#define kUntitledFolder @"untitled folder"
NSLocalizedString(kUntitledFolder, "");
In those cases one technique is to put all the possible strings in
NSLocalizedString() calls in comments; see TextEdit's ScalingScrollView.m
BTW, you don't need to use @"..." notation for comments; just "..." is
fine. It's thrown away by the compiler.
Ali