简体   繁体   中英

Eclipse RCP - Using fragment for providing translations

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.

主机片段的用法

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 :)

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!! 在此处输入图片说明

try to set the language directly

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

您提供标头清单吗?

Bundle-Localization: plugin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM