Eclipse RCP 中的plugin.xml国际化兑现

Eclipse RCP 中的plugin.xml国际化实现

对于eclipse RCP中的国际化实现可以有多种方式, 比较现代的方法是实现一个org.eclipse.osgi.util.NLS的子类, 具体的操作可以通过WindowsBuilder工具来实现.

 

在这里主要想对plugin.xml中的国际化实现做个备忘, 在这里借鉴了

http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.rap/org.eclipse.rap.help/help/html/advanced
/internationalization.html?revision=1.2&root=Technology_Project

 

类似于常用的国际化实现, 需要在工程的根目录下面建立一个plugin.properties资源文件, 然后在 MANIFEST.MF文件中增加下面这一行:

Bundle-Localization: plugin

对资源文件进行引用时, 在引用的key前面加一个%就可以了:

<extension
         point="org.eclipse.ui.views">
      <view
            id="org.eclipse.rap.helloworld.helloWorldView"
            class="org.eclipse.rap.helloworld.HelloWorldView"
            name="%helloWorldView_name">
      </view>
 </extension>