• 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: Localized alert function?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Localized alert function?


  • Subject: Re: Localized alert function?
  • From: Chris Hanson <email@hidden>
  • Date: Tue, 25 Nov 2003 14:55:44 -0600

On Nov 25, 2003, at 11:05 AM, Darrin Cardani wrote:
I'm looking at NSRunAlertPanel (). It takes several NSString* arguments. I could call:

NSRunAlertPanel (NSLocalizedString (title, comment),
NSLocalizedString (message, comment),
etc.,

in order to get localized strings, but that seems quite cumbersome. Is that the way it's usually done, or is there some better method?

As you've discovered, you can pass a format string to NSRunAlertPanel for its message, and tack on additional arguments a la printf.

The main reason to keep using NSLocalizedString() with real constant strings (i.e. @"something") is that the genstrings tool can pull them out of your source code and generate a Localizable.strings file from them automatically. Of course you could do this separately from your call to NSRunAlertPanel, and just assign the result of the NSLocalizedString() calls to variables...

-- Chris

--
Chris Hanson <email@hidden>
bDistributed.com, Inc.
Outsourcing Vendor Evaluation
Custom Mac OS X Development
Cocoa Developer Training
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Localized alert function? (From: Darrin Cardani <email@hidden>)

  • Prev by Date: Re: Localized alert function?
  • Next by Date: Re: ZeroLink and dynamic discovered Classes
  • Previous by thread: Localized alert function?
  • Next by thread: Re: Localized alert function?
  • Index(es):
    • Date
    • Thread