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 19337

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, mpetras, pkuzel
Priority: P2 Keywords: A11Y, I18N
Version: 3.x   
Hardware: Sun   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Image1.gif
Image2.gif
Image3.gif
Image1(Select).gif
Image2(Filesystem).gif
Image3(ReplaceCodeFormat).gif

Description Hiroshi Nakatsubo 2002-01-11 12:19:22 UTC
Mnemonic Keys which was mistaken on the Japanese is attached.

[case1]
1. File -> New ->GUI Forms -> JFrame.
   Form Editor[Component Inspector] windows is displayed.
2. [JFrame] is chosen within Component Inspector and Title of a Properties tab
   is chosen.Property Editor dialog is displayed.
3. Selecto Mode list chooses an Resource Bundle.
4. Browse button is pushed.
   Select Resource Bundles dialog is displayed.
5. If it translates into Japanese, mnemonic has stopped moving.
   The Mnemonic Keys of "Select".(Image1.gif)
[case2]
1. 1 to 3 is the same as a [case 1].
4. New button is pushed.
   New Bundles dialog is displayed.
5. If it translates into Japanese, mnemonic has stopped moving.
   The Mnemonic Keys of "Filesystem".(Image2.gif)
[case3]
1. 1 to 3 is the same as a [case 1].
4. Format button is pushed.
   Replace Code Format Editor dialog is displayed.
5. If it translates into Japanese, mnemonic has stopped moving.
   The Mnemonic Keys of "Replace Code Format".(Image3.gif)
  
This bug resembles http://openide.netbeans.org/issues/show_bug.cgi?id=18635.
Comment 1 Hiroshi Nakatsubo 2002-01-11 12:21:26 UTC
Created attachment 4102 [details]
Image1.gif
Comment 2 Hiroshi Nakatsubo 2002-01-11 12:23:38 UTC
Created attachment 4103 [details]
Image2.gif
Comment 3 Hiroshi Nakatsubo 2002-01-11 12:25:11 UTC
Created attachment 4104 [details]
Image3.gif
Comment 4 Tomas Pavek 2002-01-11 15:34:29 UTC
Resource Bundle editor is from i18n module...
Comment 5 _ pkuzel 2002-03-13 17:44:13 UTC
Case 1, 2 is caused by OpenIDE bug.
Comment 6 _ pkuzel 2002-03-13 17:44:29 UTC
x
Comment 7 David Simonek 2002-05-03 15:44:28 UTC
I think I don't understand where the bug is..what you mean by saying
"mnemonic has stopped moving"? Do you mean that after pressing
mnemonic key, nothing hapenned? 
Comment 8 Hiroshi Nakatsubo 2002-05-07 02:12:14 UTC
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));
Comment 9 Hiroshi Nakatsubo 2002-05-21 05:48:10 UTC
It is not corrected now, either.
Again,Please see attched image file.
Mnemonic Keys which was mistaken on the Japanese
is attached.
[case1]
      ---Image1(Select).gif
[case2]
      ---Image2(Filesystem).gif
[case3]
      ---Image3(ReplaceCodeFormat).gif


OS:Solaris 5.8  
Orion Build:orion_ml_020519
JDK:JDK1.4.0
locale:ja
Comment 10 Hiroshi Nakatsubo 2002-05-21 05:49:58 UTC
Created attachment 5867 [details]
Image1(Select).gif
Comment 11 Hiroshi Nakatsubo 2002-05-21 05:50:55 UTC
Created attachment 5868 [details]
Image2(Filesystem).gif
Comment 12 Hiroshi Nakatsubo 2002-05-21 05:52:58 UTC
Created attachment 5869 [details]
Image3(ReplaceCodeFormat).gif
Comment 13 Hiroshi Nakatsubo 2002-05-24 06:20:47 UTC
Please refer to this page.
http://ministop.japan/Products/Forte/ffj-qa-i18n/docs/misc/mnemonic.html
Comment 14 David Simonek 2002-06-03 14:59:53 UTC
yes, now I think I understand, I'll try to figure out...
Comment 15 David Simonek 2002-06-04 17:59:18 UTC
Passing back to i18n module. P. Kuzel is wrong - there is no openide
bug, Petr can you explain?

Here is what is needed to fix the bug:
1) add '&' mnemonic markers to the labels of filesystem combo boxes in
dialogs in english bundles. I already did it in main trunk
(i18n.Bundle.properties)
2) synchronize japanese bundle
BundleKey=<japanese text which means label of fs combo>(&<mnemonic key>)

Hope it's clear now.
Comment 16 _ pkuzel 2002-06-05 09:12:56 UTC
There are tens of similar reports related to NodeOperation's dialogs.
I have wrongly routed the first bunch of them to OpenIDE.

Passing to translated files because it is localization bug.
Comment 17 Marek Grummich 2002-07-22 11:41:45 UTC
Set target milestone to TBD
Comment 18 Ken Frank 2002-10-12 19:50:04 UTC
putting as P2 since A11Y issue and needs to be fixed for next
S1S release.

But why is this in translated files section - the issue reported
was an i18n one and not a localization one, and its not about
any localization being done of netbeans -- so wouldn't this
one belong in some other module ?

Thanks - Ken
ken.frank@sun.com
Comment 19 _ pkuzel 2002-10-14 10:18:05 UTC
It's localization issue, localized text must contain '&' to highlight
mnemonics.
Comment 20 Ken Frank 2002-10-14 16:34:22 UTC
Just clarifying, I think that part of fix will be to add
the & to lines that do not have it -- the localization activities
does not do this; other similar issues that have '&' used as mnemonic
that did not have '&' there, have had it added by development.

ken.frank@sun.com
Comment 21 _ pkuzel 2002-10-14 17:12:25 UTC
Do you mean that development have to explicitly add '&' marks to
default characters (first nonconflicting one it none is marked by
'&'). i.e. a Bundle.properties:

PROP_node_select_1=&Filesystem
PROP_aux=F&antasy

instead of

PROP_node_select_1=Filesystem
PROP_aux-Fantasy

Marian could you update i18n policy to mention this?
Comment 22 Ken Frank 2002-10-14 17:19:43 UTC
Yes, there needs to be '&' in any mnemonics assigned using this
approach (vs the 2 key/val approach).

This is because, if there is no '&', the first character of the
value is used, which, in a localized release, will be a multibyte
character and is not what is intended; they want to use same
assigned mnemonics as base product.

I'll send separate doc explaining this to you in case it is
helpful for i18n policy doc.

ken.frank@sun.com
Comment 23 _ pkuzel 2002-10-14 18:02:53 UTC
I looked again and trunk code is already properly i18n-ed including
mnemonics.
Comment 24 Marian Petras 2002-10-15 07:14:20 UTC
I will update the I18N policy as soon as I get permission to do so.
Comment 25 hiroshiy 2002-11-15 08:39:22 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 26 hiroshiy 2002-11-15 08:40:24 UTC
closed.
Comment 27 hiroshiy 2002-11-19 06:01:26 UTC
And I've verified, '&' sign was inserted suitably in
"Bundle.properies".
Therefore, this issue will never re-appear.
Thank you all !!
Hiroshi.