Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Dynamic language support
Dynamic language support [message #449645] Wed, 17 May 2006 10:38 Go to next message
Eclipse UserFriend
Originally posted by: mimhof.csc.com

We're developping an application with a huge client side cache wich is
running 24x7days.
Now if the user changes from german speaking to french speaking I have to
change the language of the application. Normally we would do that with a
restart
of the application. But a restart is killing our cache data!

Is this possible to change the language while a RCP application is running?

Michael
Re: Dynamic language support [message #449651 is a reply to message #449645] Wed, 17 May 2006 11:16 Go to previous messageGo to next message
Eclipse UserFriend
For your own controls, you could just update the text. For eclipse
workbench controls, I believe the text is set when they're created. If
you update so that it uses a new language pack, it won't be picked up
automatically.

Maybe creating a new workbench window would allow it to pick up the new
language stuff ...

Later,
PW
Re: Dynamic language support [message #449674 is a reply to message #449651] Wed, 17 May 2006 14:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mimhof.csc.com

Ok, i can use my own messages and translate it, but
what happens with messages in plugin.xml??

Example:
After creation of the menu in the ApplicationActionBarAdvisor, I can
translate the text of the menu, but only for the menus added in this
class. The menus defined in plugin.xml are created later..

Michael
Re: Dynamic language support [message #449702 is a reply to message #449674] Thu, 18 May 2006 07:37 Go to previous messageGo to next message
Eclipse UserFriend
Michael Imhof wrote:
> Ok, i can use my own messages and translate it, but
> what happens with messages in plugin.xml??
>
> Example:
> After creation of the menu in the ApplicationActionBarAdvisor, I can
> translate the text of the menu, but only for the menus added in this
> class. The menus defined in plugin.xml are created later..
>

Right, and they get set once at creation time ... odds are they won't
get updated.

If you change the language option and then spawn a new workbench window,
what happens? This might be your best bet, but I'm not sure it works.

Later,
PW
Re: Dynamic language support [message #449771 is a reply to message #449645] Thu, 18 May 2006 21:29 Go to previous messageGo to next message
Eclipse UserFriend
This is not supported. There is a bug report to this extent in platform
/ runtime or equinox / framework.
The core of the problem is that the content of the plugin.xml is
translated on first startup and cached to make subsequent startup faster
and it only get recomputed on startup when a language changes.

However here is something that might work in your case (I've never
tried). First the main assumptions:
- make sure you data model / cache does not dependent on the registry
nor any other eclipse plugin (btw it should not, since it is your own
model :))
- you have your own application that opens up the workbench. note that
it can not use the regular application extension point.
myApp() {
createDisplay();
openWorkbench(); // at this stage the app is up and running

if (ReturnCode of the app is change language)
stop all the plugins from your app except your data model and
osgi (you may want to look at the code in osgi that shutsdown the
platform as it needs to be done in a particular order)
change the setting of osgi.nl
restart the registry and the other bundles from the osgi.bundle
list.
restart the app
}

You might encounter problems along the way as most plug-ins will likely
still have their static fields initialized (for example SWT Display). In
this case you may want to uninstall the bundles instead of just shutting
them down and then the upadte.configurator will reinstall them.

HTH,

PaScaL

Michael Imhof wrote:
> We're developping an application with a huge client side cache wich is
> running 24x7days. Now if the user changes from german speaking to french
> speaking I have to change the language of the application. Normally we
> would do that with a restart
> of the application. But a restart is killing our cache data!
>
> Is this possible to change the language while a RCP application is running?
>
> Michael
>
Re: Dynamic language support [message #449784 is a reply to message #449702] Fri, 19 May 2006 08:06 Go to previous message
Eclipse UserFriend
Originally posted by: mimhof.csc.com

The attempt with setting the locale was not successful.My default
langugage on the pc is german. Changinge to en_US has no affect on the
string displayed (tests were made with a view title
It seems that RCP has loaded the translation static. (I also tried to
change
the text in the plugin.properties but it doesn't work).

Locale.setDefault(Locale.US);
try {
IWorkbenchWindow newWin =
workbench.getWorkbench().openWorkbenchWindow(Perspective.ID, null);
workbenchWindow.close();
workbenchWindow = newWin;
} catch(WorkbenchException e) {
e.printStackTrace();
}

Probably I have to change a setting somewhere instead of the Locale?
Or is it possible to reload this translation strings after changing the
locale?

Michael
Previous Topic:How to add a second CoolBar???
Next Topic:launching another Java app from within an RCP app
Goto Forum:
  


Current Time: Sun Aug 31 01:13:07 EDT 2025

Powered by FUDForum. Page generated in 0.06350 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top