NSLocalizedString not works in plugin

Evan Schoenberg, M.D. evan at adium.im
Tue Jan 26 01:35:29 UTC 2010


On Jan 25, 2010, at 7:25 PM, Peter Hosey wrote:

> On Jan 25, 2010, at 16:46:42, Evan Schoenberg, M.D. wrote:
>> You want to use AILocalizedStringFromTableInBundle() … with [self bundleForClass:[self class]] as the bundle argument. Otherwise, you are looking up strings from the main bundle (Adium.app's bundle) which is not what you want, as you want to look to your own plugin bundle.
> 
> But AILocalizedString is defined as using [NSBundle bundleForClass:[self class]].

Excellent point. Thanks.

AILocalizedString() should Just Work for plugins, by design.  The code the OP posted used NSLocalizedString(), which won't work without specifying the bundle.

> 
> Incidentally, why is AILocalizedStringFromTable defined as using the main bundle?
> 

Arbitrary inconsistency out of historical convenience. :\  I'd have no objection to this becoming consistent (Tom said passively).

-Evan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20100125/aa26c4dd/attachment-0002.html>


More information about the devel mailing list