• 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: NSLocalizedString() in bundles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSLocalizedString() in bundles


  • Subject: Re: NSLocalizedString() in bundles
  • From: Jesse Grosjean <email@hidden>
  • Date: Thu, 9 Jun 2005 08:59:32 -0400

Buy default most of the NSLocalizedString macros only search for strings in the main bundle. This means that if you are writing a plugin you have to use the long form NSLocalizedStringFromTableInBundle, and that tends to be a pain in the neck, lots of extra typing. Ideally I would like to redefine the NSLocalizedString macros to look like this:

#define NSLocalizedString(key, comment) [[NSBundle bundleForClass: [self class]] localizedStringForKey:(key) value:@"" table:nil]
#define NSLocalizedStringFromTable(key, tbl, comment) [[NSBundle bundleForClass:[self class]] localizedStringForKey:(key) value:@"" table:(tbl)]


But when I do that I get lots of "redefined" warnings. Is there a way to get rid of these warnings for this particular case, or a better approach to this problem that I'm not thinking about? I would like to use NSLocalizedString instead of defining my own macro so that genstrings will work.

Opps nevermind I just found a solution. genstrings can take a (-s routine) option that allows you to substitute your own routine for NSLocalizedString.


Jesse

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSLocalizedString() in bundles (From: Jesse Grosjean <email@hidden>)

  • Prev by Date: Re: NSLocalizedString() in bundles
  • Next by Date: Re: Universal Binaries, x86 and compatibility...
  • Previous by thread: Re: NSLocalizedString() in bundles
  • Next by thread: NSTableView, its data source, and their document.
  • Index(es):
    • Date
    • Thread