Re: Localized alert function?
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.