Re: [gtk-osx-users] Using localization with "Application" menu with the gtk mac integration library.




On Oct 2, 2014, at 1:03 PM, Joshua Pettus <jshpettus gmail com> wrote:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib                   0x00007fff868fd097 objc_msgSend + 23
1   libgtkmacintegration.2.dylib      0x0000000108421852 gtkosx_application_set_menu_bar + 794
2   XBoard-bin                        0x00000001077183cb GenericPopUp + 12221
3   XBoard-bin                        0x00000001076fea9b BoardPopUp + 695
4   XBoard-bin                        0x000000010770fe6a main + 3809
5   libdyld.dylib                     0x00007fff90fc65fd start + 1



Unfortunately that doesn’t tell me enough. Can you rebuild gtk-mac-integration with debug symbols and crash 
it again, please?
The easy way is to call setup_debug() before setup_sdk() in .jhbuildrc-custom and then run jhbuild buildone 
—force —clean gtk-mac-integration.

You can’t just change the keys in the strings. You also have to change the keys in the table lookup. For 
example, the “Hide” lookup is at line 246 in gtkosxapplication_quartz.c:

 menuitem = [[NSMenuItem alloc] initWithTitle: [[NSLocalizedStringFromTable (@"Hide",  
@"GtkosxApplication", @"Hide menu item title") autorelease] stringByAppendingFormat: @" %@", appname]
           action: @selector (hide: ) keyEquivalent: @"h”];

That’s not really the right way to do that, since it forces the app name to the end of the string. It also 
won’t find the key “Hide % “ in your revised strings file. It needs to be something like (because I 
haven’t tested it)

 menuitem = [[NSMenuItem alloc] initWithTitle: [stringWithFormat: [NSLocalizedStringFromTable (@“Hide %@", 
@"GtkosxApplication", @"Hide menu item title") autorelease], appname]
           action: @selector (hide: ) keyEquivalent: @"h”];

Ah, makes sense. I tried compiling it with one then the other, which succeeded, and then rebuilt xboard.   
Neither translated “Quit % “ or “Hide % “    It would be ideal to place the application name before or 
after the string depending on the language.


That’s code in gtk-mac-integration; you’ll have to change it and rebuild gtk-mac-integration for it to do 
anything.

Regards,
John Ralls




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]