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.
Summary: | I18N - mnemonic key doesn't work with translated. | ||
---|---|---|---|
Product: | utilities | Reporter: | Masafumi Matsuda <mmc131206> |
Component: | Code | Assignee: | issues@utilities <issues> |
Status: | CLOSED WORKSFORME | ||
Severity: | blocker | CC: | jf4jbug, keiichio, mbudris |
Priority: | P4 | Keywords: | A11Y, I18N |
Version: | 3.x | ||
Hardware: | All | ||
OS: | All | ||
URL: | 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) | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | snap shot |
Description
Masafumi Matsuda
2002-05-17 10:55:52 UTC
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. |