views:

396

answers:

1

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?

+3  A: 

According to this thread:

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.

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 :-)

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...)


That said, a slightly different problem was set in this thread:

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

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

I tried it manually:

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

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

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

VonC
Is it possible to get "everything" (to call setText(*) on) automatically?
zizzo