• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: simple genstrings question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >simple genstrings question (From: Steve Gehrman <email@hidden>)

  • Prev by Date: Problem : getting html data using NSString with a Proxy server
  • Next by Date: Aqua Interface Guidelines & Close Window location ?
  • Previous by thread: Re: simple genstrings question
  • Next by thread: Re: NSQuickDrawView
  • Index(es):
    • Date
    • Thread