Re: NSLocalizedString not working with Automator project ? [Solved]
Re: NSLocalizedString not working with Automator project ? [Solved]
- Subject: Re: NSLocalizedString not working with Automator project ? [Solved]
- From: Eric Morand <email@hidden>
- Date: Thu, 22 Dec 2005 17:16:07 +0100
OK, I solved it by myself thanks to the -NSShowNonLocalizedStrings
argument : NSLocalizedString looks for the Localizable.strings file
in the bundle of...Automator !
I've changed my code to :
NSString * errorMessage = NSLocalizedStringFromTableInBundle
(@"UserAccessDenied", nil, [NSBundle bundleForClass:[self class]],@""));
And it works !!!
Thanks for your time, I hope this will help someone else one day or
another.
Eric.
Le 22 déc. 05 à 17:04, Eric Morand a écrit :
Hi List !
For some reason, I'm unable to use NSLocalizedString (or the
equivalent method of NSBundle) in my Cocoa Automator Action project.
My syntax is pretty simple :
- (void)logError
{
NSString * errorMessage = NSLocalizedString(@"UserAccessDenied",
@"This is the error message sent when the host has denied access
because of wrong username/password");
NSLog (@"ErrorMessage = %@", errorMessage);
}
The NSLog function always print UserAccessDenied...
I obviously have a Localizable.strings file whose content is :
"UserAccessDenied" = "Please WORK !!!";
This file is a UTF-16 file (as adviced by Apple), it is located in
the Ressources folder of my compiled Automator Action and I've
tested it with /usr/bin/plutil to be sure it was 100% valid - and
it is !
Is there something wrong here ?
Thanks,
Eric.
_______________________________________________
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
_______________________________________________
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