> I need to implement a dynamic localization in my application, meaning the 
> user must be able to click on a button in some kind of toolbar and the UI 
> must change directly to display all texts in the chosen language without 
> restarting the application.
> ...
> So I go back to the localization feature and found on the mailing list the 
> question of Joao Neves, and the answer of Greg Brown saying 
> >If you define your UI in BXML, you can just reload it after you change the 
> >locale.
> That seems interesting but I do not understand how to “reload the UI”; if 
> someone could post a little code snippet showing how to do that, that would 
> be great.

I don't think there is an example that demonstrates how to do this, but the 
idea is pretty simple. Let's say you have a main Window defined in 
my_window.bxml. Your application loads this window in startup() and stores a 
reference to it. When you want to apply a locale change, you can reload 
my_window.bxml using the Resources loaded from the new locale.

You might be able to do this by calling shutdown() and startup() on the 
application yourself. I haven't tried it but it might be worth a shot.

G


Reply via email to