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.

Bug 23814

Summary: I18N - mnemonic key doesn't work with translated.
Product: nblocalization Reporter: Hiroshi Nakatsubo <hn131207>
Component: CodeAssignee: Hiroshi Nakatsubo <hn131207>
Status: CLOSED WORKSFORME    
Severity: blocker CC: jf4jbug, mbudris
Priority: P2 Keywords: A11Y, I18N
Version: 3.x   
Hardware: Sun   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Image1.gif
Image2.gif
Image3.gif
Image4.gif
Image5.gif
Image6.gif

Description Hiroshi Nakatsubo 2002-05-22 07:38:34 UTC
Please see attched image file.
Mnemonic Keys which was mistaken on the Japanese
is attached.

To reproduce:

[case1] 
1.ffjuser40ee/sampledir/exeamples/texteditor 
  /About.java  is chosen.
2.Right click is carried out on About.java
  and Tools->Internationalization->
  Internationalize is chosen. 
  Internationalize displays.
3-1.Browse button is pushed.
    Select Resource Budles displays.
    ---The Mnemonic Keys of "Select:".(Image1.gif)
3-2.New button is pushed.
    New Budle displays.
    ---The Mnemonic Keys of "Filesystem:".
       (Image2.gif)
3-3.Format button is pushed.
    Replace Code Format Editor displays.
  ---The Mnemonic Keys of "Replace Code Format:".
       (Image3.gif)

[case2]
1.New Folder is created.
2.Right click is carried out on New Folder
  and New->Other->Properties File is chosen. 
3.Finish button is pushed.
  Properties is created.
4.Right click is carried out on New Folder 
  and Tools->Internationalization->
  Internationalization Wizard is chosen.
  Select Sources to Internationalize(1 of 3)
  displays.
5.Add Source button is pushed.
  Select Sources displays.
  ---The Mnemonic Keys of "Filesystems:".
     (Image4.gif)
6./ffjuser40ee/sampledir/exeamples/texteditor 
  is chosen.
  Ok button is pushed.
7.Next button is pushed.
  Select Resource for Sources(2 of 3) displays.
8.Select All button is pushed.
  Select Resource displays.
  ---The Mnemonic Keys of "Filesystems:".
     (Image5.gif)
9./New Folder/properties is chosen.
  Ok button is pushed.
10.Next button is pushed.
   Modify Found String(3 of 3) displays.
   ---The Mnemonic Keys of "Source:".
      (Image6.gif)

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).

I guess other many objects are implemented like
above.
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.
            
myButton.setMnemonic(myResourceBundle.getString("Example").charAt(0));

*OS:generic 
*Orion Build:orion_ml_020519
*JDK:JDK1.4
*locale:ja
Comment 1 Hiroshi Nakatsubo 2002-05-22 07:47:25 UTC
Created attachment 5891 [details]
Image1.gif
Comment 2 Hiroshi Nakatsubo 2002-05-22 07:48:30 UTC
Created attachment 5892 [details]
Image2.gif
Comment 3 Hiroshi Nakatsubo 2002-05-22 07:49:19 UTC
Created attachment 5893 [details]
Image3.gif
Comment 4 Hiroshi Nakatsubo 2002-05-22 07:50:01 UTC
Created attachment 5894 [details]
Image4.gif
Comment 5 Hiroshi Nakatsubo 2002-05-22 07:50:42 UTC
Created attachment 5895 [details]
Image5.gif
Comment 6 Hiroshi Nakatsubo 2002-05-22 07:51:20 UTC
Created attachment 5896 [details]
Image6.gif
Comment 7 _ pkuzel 2002-05-29 13:12:15 UTC
1), 2), 4) and 5) requires '&' value escaping to tag mnemonics
3) and 6) fixed in source code
Comment 8 Marek Grummich 2002-07-22 11:41:37 UTC
Set target milestone to TBD
Comment 9 Ken Frank 2002-10-14 16:27:53 UTC
Moving to P2 after consultation with A11Y QA
since we feel that these mnemonic issues
do need to be fixed in next release.

ken.frank@sun.com
Comment 10 hiroshiy 2002-11-15 08:42:16 UTC
Hello, 

I found that, this issue is no longer re-appeared by suitable
translation. Therefore, I agree with current specs.

But, this may be re-appeared in l10n works into other language, 
in nearly future.

And I hope that, all developers put "&" which shows mnemonic
in the string, even if mnemonic is an initial character of the string.
Then, all translators can understand that exists of mnemonic.

Thank you - Hiroshi.
Comment 11 hiroshiy 2002-11-15 08:42:34 UTC
closed.
Comment 12 hiroshiy 2002-11-19 06:01:35 UTC
And I've verified, '&' sign was inserted suitably in
"Bundle.properies".
Therefore, this issue will never re-appear.
Thank you all !!
Hiroshi.
Comment 13 Jesse Glick 2002-12-23 16:35:42 UTC
Consistent use of the I18N keyword.