0

I am currently migration an Eclipse RCP application from Eclipse 3.0 to 4.4. There are language.property files where the texts for the buttons and also the keyboard shortcuts are specified.

For example, it looks like this: BenutzerNeu=&Benutzer...@STRG+ALT+B

This doesen' work.

When I change it to BenutzerNeu=&Benutzer...@CTRL+ALT+B it works fine, but now in the application the shortcut displayed also looks like CTRL+ALT+B. But because it is an application used by german speaking users it should look like this: STRG+ALT+B.

I tried to change the language to german in the program arguments of my Run configuration and in my .product-file which is then used to export it as "Eclipse product", but both didn't work.

In the old version of the program based on Eclipse 3.0 the keyboard shortcuts did work.

I think i have to configure the language somewhere else, but I can't find where to do this.

wittich
  • 2,079
  • 2
  • 27
  • 50
Pascal Petruch
  • 344
  • 3
  • 16
  • Migrating from 3.0 to 4.4 and you are only struggeling with keyboard shortcuts? I would assume you need to rewrite the whole application to make it fully E4 compliant (maybe except non-jface/swt relevant business parts) –  Nov 02 '15 at 13:25
  • :-D yeah, thought it would be harder. When the application was written I was still in 10th grade I think. There are only minor errors like the keyboard shortcuts and some english dialogs which where german before. But those can be tricky. – Pascal Petruch Nov 02 '15 at 13:38
  • So its just an attempt "to make it work" with e4-runtime, not using all the new (and fancy) features of e4? –  Nov 02 '15 at 13:49
  • Just to make it work. I think these errors are all associated with the locale of the application. But I already configured the language to german everywhere – Pascal Petruch Nov 02 '15 at 13:51

1 Answers1

2

Consider defining key bindings via the application model with the help of OS-independent names of the modifier keys, (e.g., M1 for CTRL), and let the operating system in conjunction with the locale set by the user herself take care of displaying the correct key name for the locale.

This works fine for my 4.5-based RCP on Ubuntu (cf. screenshot with German locale), and I imagine should work just as well for other OSs.

Screenshot of my Eclipse 4.5-based RCP app showing localized key names for shortcuts

s.d
  • 4,017
  • 5
  • 35
  • 65
  • Hi, thanks for the answer. I don't think that works in my application. Because it is based on Eclipse 3.0, there is no Application.e4xmi-file. (I have tried it in a separate projekt entirely based on the 4.x api, which worked) Also, all the actions are custom-actions without ids. The keyboard shortcuts worked in the old version of the program, and I think the problem is the locale. In the run configuration of the old version the language and and country is set to german, which I have adopted in the new version, but they still only work when you use "CRTL". – Pascal Petruch Nov 02 '15 at 12:23
  • 1
    FYI: The screenshot is from the same setup as yours, i.e., utilizing the 4.5 runtime, but working as an "old school" 3.x-style RCP (with extensions and whathaveyou). – s.d Nov 20 '15 at 13:11
  • so you had you old-school plugin which didn't have/use the application model (*.e4xmi-file) and you just created the application model (that file)? did you had to adapt much to change to e4 application model? this would fall under "2. Wrapping your Eclipse 4 components for Eclipse 3.x", wouldn't it? https://www.eclipse.org/community/eclipse_newsletter/2013/february/article3.php#compatibiliylayer_overview – Pascal Petruch Nov 20 '15 at 13:29