Re: toggleToolbarShown: How do I localize the menu item strings for non-supported languages?

2008-06-13 Thread Peter Ammon

Hi Ulf,

There's no simple way to inform AppKit of your translations of these  
strings.  The simplest way to insert your own titles is to do it in  
validateUserInterfaceItem like this:


@implementation MyWindow

- (BOOL)validateUserInterfaceItem:(id  
NSValidatedUserInterfaceItem)item {

BOOL result = [super validateUserInterfaceItem:item];
if ([item action] == @selector(toggleToolbarShown:)  [item  
respondsToSelector:@selector(setTitle:)]) {
	if ([[self toolbar] isVisible]) [item setTitle:@Localized Hide  
Toolbar];

else [item setTitle:@Localized Show Toolbar];
}
}

@end

Note that the behavior of overwriting a custom menu item title was  
fixed in Leopard.  In Tiger, AppKit would always modify the title of a  
toggleToolbarItemShown: menu item, overwriting any custom title.  In  
Leopard, AppKit will only swap (localized versions of) Show Toolbar  
and Hide Toolbar.  If you give your menu item a custom title, AppKit  
should not overwrite it.


Hope that answers your question,
-Peter

On Jun 12, 2008, at 12:13 AM, Ulf Dunkel wrote:


When I add the recommended menu items
  Hide Toolbar 
  Customize Toolbar... 
to my app's View menu, I can give them any text I like, but the  
Hide Toolbar string will be replaced by the system when the app is  
launched and a document window has been opened. The Action  
toggleToolbarShown: in NSWindow does all this automatically.


This works fine for all Languages which are currently supported by  
Mac OS X (and installed on my Mac).


But is there any simple way to provide both strings Hide Toolbar  
and Show Toolbar for languages which are not supported already,  
like Czech or Latvian?


Thank you - Ul



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


toggleToolbarShown: How do I localize the menu item strings for non-supported languages?

2008-06-12 Thread Ulf Dunkel

When I add the recommended menu items
  Hide Toolbar 
  Customize Toolbar... 
to my app's View menu, I can give them any text I like, but the Hide 
Toolbar string will be replaced by the system when the app is launched 
and a document window has been opened. The Action toggleToolbarShown: in 
NSWindow does all this automatically.


This works fine for all Languages which are currently supported by Mac 
OS X (and installed on my Mac).


But is there any simple way to provide both strings Hide Toolbar and 
Show Toolbar for languages which are not supported already, like Czech 
or Latvian?


Thank you - Ulf
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]