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 35312 - I18N - & not assigned to mnemonic
Summary: I18N - & not assigned to mnemonic
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: mslama
URL:
Keywords: A11Y, I18N, UI
Depends on:
Blocks:
 
Reported: 2003-08-06 19:38 UTC by Ken Frank
Modified: 2008-12-22 18:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
image of the popup (4.23 KB, image/gif)
2003-08-06 21:58 UTC, Ken Frank
Details
Occurrences of InputLine in NB codebase (5.02 KB, text/plain)
2003-08-12 10:55 UTC, mslama
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ken Frank 2003-08-06 19:38:12 UTC
(seen in rainier product
that uses 3.5.1 as base)

Rename a file popup
has New Name label
and whose mnemonic is
N

But since there is not
'&' in that label,
it will use first letter of
the string as the mnemonic,
but when this string is translated, the first
letter is not N and is some
multibyte one, so mnemonic
does not work.

Can the & be placed in this
label ?

Also, could all mnemonics that use this method be
reviewed to make sure '&'
is present
Comment 1 Ken Frank 2003-08-06 21:58:25 UTC
Created attachment 11239 [details]
image of the popup
Comment 2 mslama 2003-08-11 15:03:03 UTC
Rename action uses CTL_RenameLabel from
org.openide.actions.Bundle.properties. Should mnemonic ('&') be put at
first char? ("&New Name:")? Should this be fixed only at main trunk?

Generaly it is not possible to check all labels.

> Also, could all mnemonics that use this method be
> reviewed to make sure '&' is present

Sorry I do not understand what do you mean by that. What 'all
mnemonics'? What method? 

NbPresenter.notify() method is usualy used to display such dialogs but
it is not clear generaly what is content of such dialog and if there
is any label which should have mnemonic.

Comment 3 mslama 2003-08-11 15:10:17 UTC
In this case it would be possible for NotifyDescriptor.InputLine to
check first parameter of constructor (which is label, second parameter
is title) contains '&'. I hope it is what you meant. These strings are
localized. It means to check what bundle key is used and check bundle
key itself for every localization. I can do that for default english.
It is part of OpenIDE API => it is necessary to search whole codebase.
Comment 4 Ken Frank 2003-08-11 16:45:25 UTC
Marek,

I think what you have in your second
comment on this is what I meant.
As far as I know, there are 2 ways
that mnemonics are implemented 
- using the '&'

-using 2 key/values, one with actual
mne letter and one with the associated
label.

That is great that API can test
if a mnemonic that uses '&' actually
has one in its value of that key;
I had wanted to do this for i18n
testing by searching code base but
since there is no uniform naming
in all modules of the key whose label
have (or should have) the '&', it
seemed not possible to do.

Also, for checking the ones that
have the 2 key/val pairs for mne
letter and its label, since there
is no universal naming of the keys.

---
About api method you mention, can
you summarize steps needed and 
I will write up something and send
suggestion to all development teams
about how to do this checking.

ken.frank@sun.com
08/11/2003
Comment 5 mslama 2003-08-12 10:54:25 UTC
To get all occurrences of InputLine I used (Linux):
find /home/ms124458/local/netbeans/nbsrc_test -name '*.java' -print |
xargs grep -n 'NotifyDescriptor.InputLine' > input

Then it is necessary to check all usage of InputLine and check its
parameters.

I attach result on current main trunk (modules from 'standard' set)
Comment 6 mslama 2003-08-12 10:55:22 UTC
Created attachment 11274 [details]
Occurrences of InputLine in NB codebase
Comment 7 mslama 2003-08-12 13:05:20 UTC
I checked openide/core occurrences:
Missing '&':

openide/loaders/src/org/openide/loaders/DataFolder.java:1192
CTL_NewFolderName=Name:
Missing

openide/loaders/src/org/openide/loaders/DataTransferSupport.java:161 
SerializeBean_Text=&Name of file to serialize the instance to
OK

openide/src/org/openide/actions/RenameAction.java:67
CTL_RenameLabel=New Name:
Missing

core/windows/src/org/netbeans/core/windows/MenuFolderNode.java:103
CTL_newMenuLabel=Name:
Missing

core/windows/src/org/netbeans/core/windows/ToolbarFolderNode.java:102
PROP_newToolbarLabel=Name:
Missing

core/windows/src/org/netbeans/core/windows/ToolbarFolderNode.java:134
PROP_newToolbarConfigLabel=Name;
Missing In addition here is probably incorrectly semicolon

core/windows/src/org/netbeans/core/windows/nodes/WorkspaceNewType.java:55
NewWorkspaceLabel=New Workspace
Missing

core/windows/src/org/netbeans/core/windows/toolbars/ToolbarConfiguration.java:705
                          
PROP_saveLabel=&Name:
OK

Should all those cases be fixed? Should all be first char?
  
Comment 8 mslama 2003-08-19 15:37:48 UTC
?? Please what shoudl I do? Should I fix only Rename file or should I
fix all missing '&' for InputLine usage in openide/core? If all how?
All '&' should be added for first char in label? If you will not
respond I will fix only Rename. Thanks.
Comment 9 mslama 2003-08-20 14:04:09 UTC
I discussed with Jano Rojcek (CCing him): 

In english: You can either set mnemonic with ampersand explicitely or
leave it without ampersand. In such case InputLine assigns mnemonic to
first char of label. 

In localized bundle: If behaviour as described above is incorrect
localizators MUST explicitely add ampersand to localized bundle key to
assign some other mnemonic than default first char. (It seems to me -
I checked source code of InputLine - it is possible to avoid setting
mnemonic completely. Is it necessary not to use mnemonic?
Comment 10 mslama 2003-08-20 14:24:58 UTC
Correction to previous comment: It is NOT possible to avoid mnemonic
completely in current InputLine (I wrote incorrectly that it IS possible.)
Comment 11 jrojcek 2003-08-21 09:44:38 UTC
Marek,

please fix the following items:

openide/loaders/src/org/openide/loaders/DataFolder.java:1192
CTL_NewFolderName=Name:

openide/src/org/openide/actions/RenameAction.java:67
CTL_RenameLabel=New Name:

core/windows/src/org/netbeans/core/windows/MenuFolderNode.java:103
CTL_newMenuLabel=Name:

core/windows/src/org/netbeans/core/windows/ToolbarFolderNode.java:102
PROP_newToolbarLabel=Name:

core/windows/src/org/netbeans/core/windows/ToolbarFolderNode.java:134
PROP_newToolbarConfigLabel=Name;
*Semicolon should be replaced by colon*

core/windows/src/org/netbeans/core/windows/nodes/WorkspaceNewType.java:55
NewWorkspaceLabel=New Workspace
Comment 12 mslama 2003-08-22 13:22:04 UTC
Fixed in main trunk.
Comment 13 Lukas Hasik 2004-02-26 17:03:22 UTC
Ken, could you please verify ? Thanks advance
Comment 14 Ken Frank 2004-02-26 18:08:35 UTC
Lukas,

I can verify but can you clarify what the fix is -
do the entries that need mnemonics now have the & in front
of the letter of the mnemonic, even if mne is first letter
of the label ?

And if so,  for what modules and bundle files of each is this fixed
(I'm assuming I can see it in nb3.6 ?)

Thanks - Ken
ken.frank@sun.com
02/26/2004
Comment 15 Lukas Hasik 2004-02-27 10:29:06 UTC
it's probably question for Marek or Jano, could you guys clarify ? thanks
Comment 16 jrojcek 2004-03-05 21:28:08 UTC
My impression is that all occurrences of label in Input Line type dialog has been fixed to 
contain '&' in property files.
Comment 17 Marian Mirilovic 2004-03-13 11:30:50 UTC
All, here explicitely pointed bundles/keys are fixed for 3.6 - verified

Ken, if you find another wrong 'mneminized' label file new issuea
gainst appropriate module, thanks in advance.