Overriding language selection [message #433907] |
Sun, 17 July 2005 14:52  |
Eclipse User |
|
|
|
Hi,
I have an RCP application with English and German plug-in property files
plugin_en.properties and plugin_de.properties.
The application selects according to the locale in Control Panel
(Windows), or if I start with a VM argument -nl=de or -nl=en it works
appropriately.
However, what I would like is to read this property from another settings
file and override it programmatically? The aim is to let the user change
the setting from the RCP GUI and restart the application in the different
language, without requiring them to fiddle around with command line
arguments or Control Panel.
I tried changing the setting of the System osgi.nl property in the run
method of the RCP application, but it seems to happen too late to affect
the choice of plugin_XX.properties.
Any suggestions?
Thanks
Roger
|
|
|
Re: Overriding language selection [message #433923 is a reply to message #433907] |
Mon, 18 July 2005 14:06   |
Eclipse User |
|
|
|
Hi
It seems if you do it progrmmatically, it is too late to take effect as
Eclipse seems to usethe osgi.nl value at startup to set the locale and load
the necessary ResourceBundles.
In addition to command line, the osgi.nl can be set in a config.ini file.
This file is loaded by Eclipse on startup and overrides the command line
arguments.
For Eclipse 3.0, you can try overwriting the config.ini in the configuration
folder. This folder will be in same folder as startup.jar
Using the Platform class, you can getCurrentInstalledLocation URL.
So the path to config.ini will be Platform.getCurrentInstalledLocation +
"/configuration/config.ini"
Use a Property class to overwrite this file everytime the user changes.
Arun
"Roger Nye" <roger@nye.ch> wrote in message
news:66578dee14b0d01aebb0986dc55e50f7$1@www.eclipse.org...
> Hi,
> I have an RCP application with English and German plug-in property files
> plugin_en.properties and plugin_de.properties.
>
> The application selects according to the locale in Control Panel
> (Windows), or if I start with a VM argument -nl=de or -nl=en it works
> appropriately.
>
> However, what I would like is to read this property from another settings
> file and override it programmatically? The aim is to let the user change
> the setting from the RCP GUI and restart the application in the different
> language, without requiring them to fiddle around with command line
> arguments or Control Panel.
>
> I tried changing the setting of the System osgi.nl property in the run
> method of the RCP application, but it seems to happen too late to affect
> the choice of plugin_XX.properties.
>
> Any suggestions?
>
> Thanks
> Roger
>
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03292 seconds