Re: [Gtk-osx-users] How to handle the standard menuitem 'quit'?
- From: Zbigniew Diaczyszyn <z dia gmx de>
- To: GTK+-2 OSX Users <gtk-osx-users lists sourceforge net>
- Subject: Re: [Gtk-osx-users] How to handle the standard menuitem 'quit'?
- Date: Wed, 22 Sep 2010 21:45:21 +0200
Am 20.09.2010 17:07, schrieb John Ralls:
>> How can I change the *labeltext* 'quit', e.g. to a 'quit my_app' or a
>> translation?
>
> a: Quit is handled directly by OSX, so you have to do it their way. The signals that gtkosxapplication provides make the OSX notification and response available to Gtk+ code. If you'd rather, you can write your own cocoa application delegate and register it -- but you'd better know what you're doing.
>
> b: The "Quit" menu label is at present hard-coded. The easy way to change it is to just edit that string in ige-mac-integration/src/gtkosxapplication_quartz.c at line 208 and the corresponding translations in the message files in ige-mac-integration/strings. It would be better, I suppose, to get the application name from the bundle and insert it, as OSX does with the built-in menu. Perhaps I'll add that at some point when time permits.
What about replacing the NSString by a NSLocalizedString in the
following line? Then the application could look into the language
folder, e.g. /de.lproj, in /Resources for a translation resource like
'Localized.strings'?
menuitem = [[NSMenuItem alloc] initWithTitle:@"Quit"
action:@selector(terminate:) keyEquivalent:@"q"];
->
menuitem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Quit", nil)
action:@selector(terminate:) keyEquivalent:@"q"];
and so for the other menuitems ...
Regards
Zbigniew
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]