One Quickie


Making localizable strings (NSString->General)
You will need a file named Localizable.strings that lives in your English.lproj directory (or whatever localization directory is appropriate). It has this syntax:
"BorkDown" = "BorkDown";
"Start Timer" = "Start Timer";
"Stop Timer" = "Stop Timer";
That is, a key followed by a localized value.

In your code, you can then use NSLocalizedString() or one of its variants:

        [statusItem setTitle: NSLocalizedString(@"BorkDown", nil)];
The second argument is ignored by the function. Obstensively it is a /* comment */ in the strings file so that you can match the key back to what it is supposed to actually be.



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com