Eclipse RCP应用程序中的动态语言切换 [英] Dynamic language switching in an Eclipse RCP application

查看:549
本文介绍了Eclipse RCP应用程序中的动态语言切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用本地化的Eclipse RCP应用程序。用户应该能够动态更改应用程序中使用的语言。在此语言切换期间不应重新启动应用程序。还应该可以在从左到右书写的语言和从右到左书写的语言之间切换。

是否有(好的)方法来解决这个问题?

I am working on an Eclipse RCP application with localization. A user should be able to change the language used in the application on the fly. A restart of the application should not take place during this language switch. It should also be possible to switch between languages written from left to right and languages written from right to left.
Is there a (good) way to solve this problem?

推荐答案

根据这个主题


大多数eclipse库会在创建小部件时加载他们的语言信息。如果您之后更改了语言环境,则需要重新启动eclipse才能使其生效。

Most of the eclipse libraries load up their language info on widget creation. If you change your locale afterwards you need to restart eclipse to have it take effect.

您可以将这种动态行为写入您自己的SWT程序中(但是语言环境切换,你需要在所有内容上调用 setText(*) : - )

You could write that kind of dynamic behaviour into your own SWT program, however (when the locale switches, you'd need to call setText(*) on everything :-)

因此,除非您自己编程,否则目前不会动态动态管理


其他rcp / plugins应用程序像Birt 指定相同的指令(即重启Eclipse 最后......

So this is not currently managed dynamically unless you program it yourself...
Other rcp/plugins application like Birt specify the same instructions (i.e. "Restart Eclipse" at the end...)

也就是说,在此主题

切换语言设置,重启,然后以该语言运行

switch the language setting, restart, and then run in that language

我通过阅读错误222023 并模仿它来开展工作 org.eclipse.ui.internal.ide.actions.OpenWorkspaceAction

I got it to work by reading bug 222023 and mimicking org.eclipse.ui.internal.ide.actions.OpenWorkspaceAction

我手动尝试了:


  • -configuration @ user.home / .myapp / configuration 添加到launcher.ini

  • 向用户 config.ini 添加 osgi.nl 在那里工作。

  • added "-configuration @user.home/.myapp/configuration" to the launcher.ini
  • added "osgi.nl" to the users config.ini residing there and it worked.

因为我可以通过 config-Location 来访问 Platform.getConfigurationLocation()我想这可能就是这样。

Since I can access the config-Location via Platform.getConfigurationLocation() I guess that could be the way.

注意:将 osgi.nl 添加到webstart jnlp 也适用

Note: adding "osgi.nl" to the webstart jnlp works too.

这篇关于Eclipse RCP应用程序中的动态语言切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆