|
|
#1 |
|
Localize NSMenu Title
is this not possible? i have all my NSMenuItems hooked up and localized fine, but the NSMenu title is not being localized
Code:
#import <Cocoa/Cocoa.h>
@interface AppController : NSObject
{
//Main Menu Outlets
IBOutlet id MenuItem1;
IBOutlet id MenuItem2;
}
@end
#import "AppController.h"
static NSString * CONSTMenuItem1;
static NSString * CONSTMenuItem2;
@implementation AppController
- (void)awakeFromNib
{
CONSTMenuItem1 = NSLocalizedString (@"ENGLISH MENU", nil);
[MenuItem1 setTitle:CONSTMenuItem1];
CONSTMenuItem2 = NSLocalizedString (@"English Item...", nil);
[MenuItem2 setTitle:CONSTMenuItem2];
}
@end
any help would be great. |
|
|
|
0
|
|
|
#2 |
|
Internationalisation via Interface Builder
If you don't need to localize programmatically, here's the procedure:
As for why your approach didn't work, I think you're spot on that it's because you don't have a pointer to the NSMenu. Any reason you didn't add a menu outlet to your controller and target the NSMenu in IB? Of course it's now unnecessary, given the above localization procedure. |
|
|
|
0
|
|
|
#3 |
|
hi... your suggested procedure is exactly what i've been trying to avoid
![]() i'm aware that is how to localize normally, but for me i just find it much easier to have a localization class with all the NSString constants so i can keep track easier... i received the answer from another board a while back: Code:
[[[[NSApp mainMenu] itemAtIndex:1] submenu] setTitle:NSLocalizedString(@"File", nil)]; |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| Why am I getting such a low Local Network file transfer speed? | alexreich | Mac Basics and Help | 1 | Apr 13, 2012 01:48 AM |
| iTunes not sending Titles to Nicecast | siys | Mac Applications and Mac App Store | 0 | Jul 22, 2011 04:06 PM |
| Help with localization (using nib files) | Nekbeth | iPhone/iPad Programming | 2 | Jun 23, 2011 08:47 AM |
| NSMenu title cut off | S0ULphIRE | Mac Programming | 4 | Apr 29, 2010 02:55 AM |
All times are GMT -5. The time now is 11:41 AM.







Linear Mode

