Eclipse RCP - Using fragment for providing translations

703 Views Asked by At

I've got short question about using Fragments in Eclipse RCP. Currently I'm using the Messages-mechanism to translate my strings. The Messages.java and the *.properties files are located in my Plugin and everything is working fine. Now I'd like to use different Strings/Translations for different customers. As far as I know Plugin-Fragments are a possible solution here. I've read that it's not possible to override files in a host plugin using a fragment. So I think I've to use 2 different fragments which provide the correct *.properties file. The following image shows the schema I think I must use.

Host-Fragment-Usage

After configuring the fragment projects (the host-plugins are set and the *.properties files are in a equally named package to the one in the host) I'd like to start my RCP Application via Eclipse IDE. The 2 Run Configurations are configured, too. When using the OSGI console I see that my fragment is present and RESOLVED.

But my problem is that the provided strings/translations from the fragments are not used. Each time I start the Application some old Strings/Translations are used (the one that were used before moving the property-Files to the fragments).

Does someone have any idea what I'm doing wrong and if my solution is the right approach?

Thanks in advance :)

2

There are 2 best solutions below

6
Martin Frank On

you have to run the eclipse product with the proper configuration - if you want to see (and test) your language support you have to start eclipse with the proper information!! enter image description here

try to set the language directly

-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl de_DE -consoleLog

4
Peter Kirschner On

Do you provide the header the manifest?

Bundle-Localization: plugin