Re: Using the Apple menu (Apple.laf.useScreenMenuBar) the menu items are always in English whatever set as Preferred Language

2013-12-25 Thread Petr Pchelko
Hello, Paul.

Sorry for the delayed answer.

The problem is that we are relying on Cocoa to create these menu items. 
However, to properly understand the locale Cocoa needs a special key in the 
Info.plist file (CFBundleAllowMixedLocalizations). However when you are running 
a java application as java -jar … there’s no Info.plist file, so Cocoa does not 
use the locale preferences and displays everything in English. We have the same 
problem with a native FileDialog. 

The problem does not seem to be fixable internally in JDK, because there’s no 
API to tell Cocoa that we wish to use CFBundleAllowMixedLocalizations key. The 
only possible workaround right now is to use the javafxpackager tool and create 
a native bundle with your application. Bundled apps have an Info.plist and 
Cocoa localization works well with them.

For more info please look at the following JDK bug: 
https://bugs.openjdk.java.net/browse/JDK-8019464 It’s about the FileDialog, but 
everything there applies to the default menu items as well.

With best regards. Petr.

12 дек. 2013 г., в 8:14 после полудня, Paul Taylor paul_t...@fastmail.fm 
написал(а):

 Using the Apple menu (Apple.laf.useScreenMenuBar) the special menu items are 
 always in English whatever set as Preferred Language
 
 OSX:System Preferences:Language and Region:Preferred Languages
 
 i.e it stills say
 
 Preferences...
 Show All
 Hide Others
 etc
 
 in the first menu (my own menu items using my own resource bundle are fine)
 
 instead of:
 
 Préférences
 Tout afficher
 Masquer les autres
 
 even if change preferred language from English to French and reboot
 
 This works properly using Java 6
 
 Is this a known bug, is quite problematic because it makes Java applications 
 look rather amateurish in non-english env.
 
 Paul
 
 



Re: Using the Apple menu (Apple.laf.useScreenMenuBar) the menu items are always in English whatever set as Preferred Language

2013-12-25 Thread Paul Taylor

On 25/12/2013 13:26, Petr Pchelko wrote:

Hello, Paul.

Sorry for the delayed answer.

The problem is that we are relying on Cocoa to create these menu items. 
However, to properly understand the locale Cocoa needs a special key in the 
Info.plist file (CFBundleAllowMixedLocalizations). However when you are running 
a java application as java -jar … there’s no Info.plist file, so Cocoa does not 
use the locale preferences and displays everything in English. We have the same 
problem with a native FileDialog.

The problem does not seem to be fixable internally in JDK, because there’s no 
API to tell Cocoa that we wish to use CFBundleAllowMixedLocalizations key. The 
only possible workaround right now is to use the javafxpackager tool and create 
a native bundle with your application. Bundled apps have an Info.plist and 
Cocoa localization works well with them.

For more info please look at the following JDK bug: 
https://bugs.openjdk.java.net/browse/JDK-8019464 It’s about the FileDialog, but 
everything there applies to the default menu items as well.

With best regards. Petr.

Thanks, my application is actually packaged using this fork of 
appbundler https://bitbucket.org/infinitekind/appbundler


So will
keyCFBundleAllowMixedLocalizations/key

work for that as well ?

paul