简体   繁体   English

Eclipse插件的国际化

[英]Internationalization of an Eclipse plugin

I have a problem with internationalization (I18n). 我对国际化(I18n)有问题。

I have followed almost all the tutorials I could find , I have created a message.java file , message_en.properties , and message_de.properties, but the problem is I don't know what to write inside my main class to call the budles. 我已经遵循了几乎所有可以找到的教程,创建了message.java文件,message_en.properties和message_de.properties,但是问题是我不知道在主类中写什么来调用蓓蕾。

I mean when I click on a button , my plugin language should change from English to German. 我的意思是,当我单击按钮时,我的插件语言应该从英语更改为德语。

What should I do ? 我该怎么办 ?

You can't have a button that changes the languages instantly, a restart is needed for the plugin to reload the bundles. 您没有按钮可以立即更改语言,插件需要重新启动才能重新加载捆绑软件。

Changing the locale programatically isn't easy. 以编程方式更改区域设置并不容易。 The simplest way seems to be to change the yourproduct.ini file (or config.ini in your plugin) in order to change the language. 最简单的方法似乎是更改yourproduct.ini文件(或插件中的config.ini )以更改语言。 For example : 例如 :

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
-nl
it
-vmargs
-Xmx1024m
-Xms412M

The important config is -nl it (for Italian here). 重要的配置是-nl it (此处为意大利语)。 You need to restart Eclipse/your product after that of course. 当然,您需要在那之后重新启动Eclipse /您的产品。

Here's the most complete tutorial I know regarding i18n in RCP applications : http://www.vogella.com/articles/EclipseInternationalization/article.html#i18n_osgi 这是我所知道的有关RCP应用程序中的i18n的最完整的教程: http : //www.vogella.com/articles/EclipseInternationalization/article.html#i18n_osgi

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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