问题引入
开发RCP时,遇到 plugin.xml 中 "%XXXX"这样的字符串不显示 plugin.properties 设置的内容的问题,我们看一下官方解释:
http://nricheton.homeip.net/?p=83 原文链接
Localization in RCP plugins is usually done by including translations
in a property file and using their id in plugin.xml.I spend some time lately trying to understand why some translations
were not used in my application although they were correctly displayed
in PDE.Answer : when using plugin.properties, you MUST include the following
line in the plugin manifest :Bundle-Localization: plugin
Otherwise, PDE will show the translated text, but your app won’t.
Strangely, I had to edit the manifest manually because I couldn’t find
a way to enable plugin localization in PDE. Some other plugins of my
application already had this line, but I don’t remember adding it.
Maybe Eclipse templates have changed since I created my first plugins
(using Eclipse 3.1).
总结
在 MANIFEST.中添加 Bundle-Localization: plugin ,这个可以让 % 匹配到 plugin.properties 中的内容
本文介绍了解决RCP应用中插件国际化显示问题的方法。通过在MANIFEST.MF文件中添加Bundle-Localization:plugin配置,使得plugin.xml中引用的资源能够正确地从plugin.properties文件中读取翻译后的文本。
356





