This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Please see attched image file. Mnemonic Keys which was mistaken on the Japanese is attached. To reproduce: 1.Highlight a file or directory on the Explorer. 2.Tools -> Create Group The Mnemonic Keys of "Look In" Would you check if the first character is not used as mnemonic key? By localization, the first character becomes no-ascii character. As a result, the mnemonic key doesn't work by localization. To fix this problem, we need to set two resource bundle messages, one is for caption, another is for mnemonic. Example=TestString Example_Mnemonic=T And we should use like this: myButton.setText(myBundle.getString("Example")); myButton.setMnemonic(myBundle.getString("Example_Mnemonic").charAt(0). The following line does not work with localized version, because the first character is not an alphanumeric because it's replaced to multi-byte Japanese character. OS:Solaris 5.9 Orion Build:orion_ml_020507 fcc Build:20.4 JDK:JDK1.4.0 locale:ja
Created attachment 5801 [details] snap shot
I added the keyword "A11Y" for the bug. But I could not add the interest list for the bug. (michele.budris@sun.com)
Q: If I understand it right expresion 'myBundle.getString("Example_Mnemonic").charAt(0)' does not return correct values which is assigned to "Example_Mnemonic" key? Is it correct? If it is, then it should be problem with all mnemonics in IDE because "two resource bundle keys" is preferred way, how to set mnemonic.
Second try: Or do you have problem to localize 'Object Name' mnemonic? Did you include '&' into localized value (what marks mnemonic)?
As you mentioned, 'myBundle.getString("Example_Mnemonic").charAt(0)' should work correctly. I've checked the attached image file. In English version, the mnemonic of "Look In" is 'L', and in localized window, the first character is set as mnemonic key. The localized first character does not work as mnemonic because mnemonic must be one of the ascii characters. // It will not work when we localize setText(bundle.getString("KEY_OF_LOOK_IN"); setMnemonic(bundle.getString("KEY_OF_LOOK_IN").charat(0)); // It will work with localization setText(bundle.getString("KEY_OF_LOOK_IN"); setMnemonic(bundle.getString("KEY_OF_LOOK_IN_mnem").charat(0)); KEY_OF_LOOK_IN=Look In KEY_OF_LOOK_IN_mnem=L Would you please check the source code how it set the mnemonic? Regards, Keiichi
OK, now I understand. I will go through all sources and where it will be possible I will add key for mnemonic. But 'Look in' is something different (see issue URL). This component is created by openide (org.openide.TopManager.NodeOperation.select(...)) which takes just a String, but please look at rootTitle description -- label at root of dialog. May use & for a mnemonic. So you should use & before character which represents mnemonic (& will not be displayed).
Used separated MNEM keys for mnemonics.
Hello Libor, Please revise the string as follows. If I add japanese characters (in "Bundle_ja.properties" file), mnemonic is appeared on the first character, even if the first character is double bytes character. --- org/netbeans/modules/group/Bundle.properties PROP_Look_In=Look In ==>> PROP_Look_In=&Look In --- ~~~ Hiroshi
See my [2002-05-24 03:37 PDT] comment -- PROP_Look_In value have to contain & for mnemonic (first char is default), see <http://www.netbeans.org/download/apis/org/openide/TopManager.NodeOperation.html#select(java.lang.String,%20java.lang.String,%20org.openide.nodes.Node,%20org.openide.nodes.NodeAcceptor,%20java.awt.Component)>. If I understand your comment, if you add & to PROP_Look_In's value in Bundle_ja.properties, it will fix your problem. Right?
Sorry Labor, I decide that, I agree with your current fixing. Because, your modification is correct. I will investigate a problem of API's fundamental spec for l10n work, in the outside of this issue. I am sorry to confuse you. Hiroshi.
I've verified the fixing in "NetBeans Development Build (200210030100)". Thank you - Hiroshi.
This issue is no longer reappeared. Because, this function was already removed. Therefore, this issue should be closed. Hiroshi.
Consistent use of the I18N keyword.