简体   繁体   English

如何从插件获取Eclipse的当前语言环境?

[英]How to get current locale of Eclipse from a plugin?

The locale of Eclipse can be set at start up via eclipse.ini adding this line: 可以在启动时通过eclipse.ini添加以下行来设置Eclipse的语言环境:

-Duser.language=<locale>

But how can I get the locale in an Eclipse RCP application (plugin)? 但是,如何在Eclipse RCP应用程序(插件)中获取语言环境?

To load the "-Duser.name=xxx" in a eclipse.ini file within a plugin product. 在插件产品的eclipse.ini文件中加载“ -Duser.name = xxx”。 Just use System.getProperty("user.name") . 只需使用System.getProperty("user.name") Hope this may help you. 希望这对您有帮助。

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

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