[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSApplication bug/suggestion?
From: |
Stefan Urbanek |
Subject: |
Re: NSApplication bug/suggestion? |
Date: |
Thu, 15 Nov 2001 23:53:15 +0100 |
Ludovic Marcotte wrote:
>
> Hi,
>
> In NSApplication: -setMainMenu, we search for setting our _windows_menu
> ivar by comparing the title of the menu items of the main menu with
> @"Windows" and @"Window".
>
Good point. And what about "Services" menu also?
> Everything is fine except when your run an application that has been
> translated to an other language and the menu item is not "Windows" (like
> "FenĂȘtres" in french).
>
> In that case, _windows_menu will always be nil and
>
> NSApplication: -changeWindowsItem: title: filename: won't do anything
> (ie., we won't have the list of opened windows in the [NSApplication
> -windowsMenu]).
>
> This problem comes from the fact that we are sharing the main menu for
> each language. This problem is easy fixable if we use a "main nib" for
> each different languages (like under OPENSTEP and MacOS-X) with its own
> menu.
>
> To fix this problem under GNUstep (if we don't want to use nibs for now),
> I think we should introduce an ivar:
>
> NSString *_windows_menu_title;
>
> and a method:
>
> - (void) setWindowsMenuTitle: (NSString *) theTitle; (that sets the ivar).
>
> By default, this ivar will be set to "Windows". A developer could do
> for example:
>
> [NSApp setWindowsMenuTitle: @"FenĂȘtres"] (or any string it a different
> language)
>
> [NSApp setMainMenu: myMainMenu];
>
> and things would be fine.
I think, if there is more localizable strings like this, what about creating
something like AppKit.strings localizable file?
Stefan