Bug 8652 - ctl-space doesn't wrk for content assist in Java editor when Locale is set to Italian
Summary: ctl-space doesn't wrk for content assist in Java editor when Locale is set to...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Kai-Uwe Maetzel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-28 23:24 EST by Paula Cox (WSAD) CLA
Modified: 2002-03-05 10:22 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paula Cox (WSAD) CLA 2002-01-28 23:24:57 EST
To reproduce: 

1) Set your Locale to Italian
On Windows 2000 choose, Start->Setting->Control Panel->Regional Options
then choose "Italian (Italy)" for the local.

2) Open a Java Editor on any .java file, create an variable, and
do control and space next to that variable.

EXPECTED BEHAVIOR: Content Assist window would pop up.
ACTUAL BEHAVIOR:  A space is added to the text


It works fine with a Spanish(Spain) locale. Only our Italian testers have 
reported the problem to us so far.
Comment 1 Erich Gamma CLA 2002-01-30 19:32:54 EST
To avoid these problem we should over a 2nd code assist trigger as VA/Java did.
Comment 2 Kai-Uwe Maetzel CLA 2002-02-08 09:16:48 EST
The assumption is that it happens with the English version of eclipse running 
on an Italian locale. Following the given steps, we were not able to reproduce 
the described behavior. Anyway, we provide the following fix:

If JavaEditorMessages.properties contains a specification for an accelerator 
for the code assist action for Italian locale, this accelerator is used when 
running on an Italian locale. In any other case the default accelerator is 
used. Based on which shortcuts are still available, the Italian accelerator is 
now set to Ctrl+K. The concrete line in the properties file is:
"ContentAssistProposal.italianAccelerator=Ctrl+K"
If the fix does not work as expected, this line can simply be removed to 
restore the original behavior.
Comment 3 Kai-Uwe Maetzel CLA 2002-02-08 09:29:12 EST
Changed to fixed.
Comment 4 Andre Weinand CLA 2002-02-13 06:35:51 EST
Verified that shortcut for code assist is Cntr-K under Italian locale.

(Note: Eclipse is not notified about switching the locale; I had to restart 
Eclipse after switching to Italian locale)
Comment 5 Paula Cox (WSAD) CLA 2002-02-15 00:45:05 EST
Hello, 
I got a comment from our Japanese tester that they are seeing the same problem. 
What shortcut should they be using?    Does your fix ONLY work for Italian? 
Will it work for other locales that have this same problem? 

Can you explain the design so that we can document it properly  e.g. which 
countries/locales use which shortcut for code assist?  Will Italian (and  other
locales with this problem) ever be able to use Ctrl+ Space?

I will test the ctrl-K as soon as we get the patch set (in the next day or so as 
I understand it)

To answer your earlier question, I reproduce this problem on an English machine 
(my primary development machine), running Windows 2000, with the locale set to 
Italian (I'm not sure if you would call that an Engliah machine). I am running 
the Workbench, but I have a translated version of the workbench, so all of the 
text on my screens are in Italian.

I cannot reproduce the problem without the translations/fragments installed from 
the following zip file:   wswb-merge-jdt-runtime-nlfragments-R1.0-121701.zip
Comment 6 Kai-Uwe Maetzel CLA 2002-02-17 20:09:57 EST
If you see it when using the translated version then it could be possible that 
the shortcuts in the property files have been omitted or have not been 
translated correctly. As we could not reproduce the problem when using the non-
translated version of eclipse, it could be worth to check the property files 
for the Italian and the Japanese version of eclipse. In addition, if incorrect 
property files cause the problem, the fix I provided does not help you.
Comment 7 Paula Cox (WSAD) CLA 2002-02-18 03:00:14 EST
Hello, 

Thanks for the response.   I have tested the Rollup 2, and Ctrl+K now works for 
Italian. 

By the way, I tested on a Spanish locale, and it seems to be broken too.   The 
Brazilian Portugese was the one that was working.  In summary: 
   ASSUMED WORKING: Korean, Brazilian and the 2 Chinese languages.
   BROKEN:  German, Spanish, Italian, Japan, French

The JavaEditorMessages_*.properties have not been omitted, they are translated 
and in the nl1.jar file.   I looked into what you said about the files not being 
translated "correctly", and you have a great point.

Here is the contents of the JavaEditorMessages_es.properties (Spanish) file 
relating to Content Assist (which does not work): 
ContentAssistProposal.label=A&yuda de contenido@Control+Espacio

if I change it to this then it does work:
ContentAssistProposal.label=A&yuda de contenido@Ctrl+Space

So, it seems like the text on the Edit menu for "Ctrl+Space" cannot be 
translated into words that are understandable for that language and still have 
them work.   This is not good NLS enablement.

In the short term, it seems like I need the properties files fixed, so that they 
 do not have translated shortcuts (make them all say "Ctrl+Space") and then the 
function works properly.  I think we should remove the 
ContentAssistProposal.italianAccelerator workaround too.  Do I work with the 
WSWB folks to get those files updated?

In the long term (V2.0) you really should separate the function ("Ctrl+Space" ) 
from the translation that appears on the Menu ("Control+Espacio") by having 2 
lines in the properties files, something like this:  
    ContentAssistProposal.label=A&yuda de contenido@Control+Espacio
    ContentAssistProposal.shortCutKey=Ctrl+Space

By the way, there are other places were shortcut keys do not work  because a 
country translated them (it's not just  content assist that is having the 
problem) - for example the Open Type Browser in German translated 
the shortcut to  Strg+Umschalt+T, and so now it doesn't work.  So, this is a 
global problem.

So, without these updated translation file, I guess there is no way for the 
Japanese (or these other broken languages) to have a shortcut key, right?

Thanks for your help...and I look forward to your response.
Comment 8 Paula Cox (WSAD) CLA 2002-02-25 00:15:12 EST
Hello, I have some more information if it helps.  

I tried to see if there is a workaround for this Content Assist problem.

I changed the fragment    fragments\org.eclipse.jdt.ui.nl1\nl1.jar  and 
specifically the JavaMessageEditor_*.properties file for each language that had 
a translated shortcut.   For example  I changed
	ContentAssistProposal.label=A&yuda de contenido@Control+Espacio
to
	ContentAssistProposal.label=A&yuda de contenido@Ctrl+Space
I created this change in a new versioned fragment 
(fragments\org.eclipse.jdt.ui.nl1_1.0.1).  

I had to make this change for  German, Spanish, French, Italian and Japan since 
there were the countries that translated "Ctrl+Space" in this file.  The 
workaround still doesn't fix everything, but it doesn't make anything worse.

I have tested all of the languages, and here are the results:
Spanish - BETTER
	Before this fix:  	No shortcut for Content Assist
	With this fix:	 Ctrl+Space is the shortcut
French  - BETTER 
	Before this fix:  	No shortcut for Content Assist
	With this fix:	 Ctrl+Space  is the shortcut
German - BETTER 
	Before this fix:  	No shortcut for Content Assist
	With this fix:	Ctrl+Space  is the shortcut

Japanese - SAME (broken)
	Before this fix:  	No shortcut for Content Assist
	With this fix:	No shortcut for Content Assist
Chinese - CN (PRC)  - SAME (broken)
	Before this fix:  	No shortcut for Content Assist
	With this fix:	No shortcut for Content Assist
China - Twain - SAME (broken) 
	Before this fix:  	No shortcut for Content Assist
	With this fix:	No shortcut for Content Assist
Brazilian Portugese  - SAME (broken)
	Before this fix: 	No shortcut for Content Assist
	With this fix:	 No shortcut for Content Assist

Korean  - SAME  (working)
	Before this fix:  	Ctrl+Space  is the shortcut
	With this fix:	 Ctrl+Space  is the shortcut
English - SAME (working)
	Before this fix:  	Ctrl+Space  is the shortcut
	With this fix:	Ctrl+Space  is the shortcut
Italian -  (requires the patch we got from OTI to make it work) - SAME (working, 
sorta)
	Before this fix:  	No shortcut for Content Assist
	With this fix: 	Ctrl+K is the shortcut


I don't know why it's still broken in some languages.  Perhaps they need 
a similar workaround like you put in for Italian.

Also, something (pleasantly) unexpected happened.  When I changed the shortcut 
from being translated (Control+Espacio) to English (Ctrl+Space), I expected the 
shortcut on the Edit menu to be in English.  But it wasn't - they were 
translated on the Menu.  I tried to find out where the translated text was 
coming from.  I search the JDT UI properties files and the only other place I 
can see the translated text was in a properties file for the Snippet Editor.  
I'm glad, since this is the behavior we want, but it was a pleasant suprise for 
me.  Any insite on this?
Comment 9 Paula Cox (WSAD) CLA 2002-02-27 01:05:09 EST
With help from Kevin, we were able to determine that the problem was that the 
translated shortcuts in the JavaEditorMessages.properties file MUST match the 
translated accelerator keys in the 
org.eclipse.ui.nl1\org\eclipse\jface\messages_xx.properties files.  Once we 
matched those up, we were good to go.  The only exception was for the Chinese 
languages where Ctrl+Space was already mapped in the IME in the operating 
system. For those 2 languages, we mapped Content Assist to Ctrl+K.
Comment 10 Kai-Uwe Maetzel CLA 2002-03-05 10:22:32 EST
Issue resolved. Error in translated properties file.