Chen,
You want to use AILocalizedStringFromTableInBundle() (or
NSLocalizedStringFromTableInBundle() which is identical, as the former is
#define'd as the latter) 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.
Cheers,
Evan
On Jan 23, 2010, at 10:43 PM, Chen Ze wrote:
> Below is the code. it works in an normal(like window based) cocoa
> program but not works when I use in an adium plugin.
>
> - (void)installPlugin
> {
> NSAlert *alert =
> [NSAlert
> alertWithMessageText:NSLocalizedString(@"my title", @"")
> defaultButton:NSLocalizedString(@"OK", @"")
> alternateButton:nil
> otherButton:nil
> informativeTextWithFormat:NSLocalizedString(@"my text",@"")];
> [alert
> performSelector:@selector(runModal)
> onThread:[NSThread mainThread]
> withObject:nil waitUntilDone:NO];
> }
>
> and the the files are:
> zh_CN.lproj/Localizable.strings
> English.lproj/Localizable.strings
>
> I also tried AILocalizedString with the table name which is same as
> bundle name.it also not works.
>
> Did I miss something? I am new to plugin development.
>
> --
> aka Surf Chen
> http://chenze.name/
>