You probably already know about it, but I wanted to mention the existing 
LocaleProvider API in Equinox. It is intended to isolated clients for the 
process of locale lookup, and is used for example to support multiple 
simultaneous locales in the extension registry. Ideally the multi-language 
story for the application model should be consistent with this, so an 
application that wants to provide multi-locale doesn't need to register 
multiple mechanisms. Something like LocaleProvider, combined with an event 
on the event bus that notifies on locale changes, feels like the basic 
pieces we need. On locale change clients could use LocaleProvider to 
obtain the new value. For injection clients we could even directly inject 
Locale object directly and take care of the events/dynamism within the 
framework.

John



From:   Tom Schindl <[email protected]>
To:     E4 Project developer mailing list <[email protected]>, 
Date:   11/19/2013 06:31 PM
Subject:        [e4-dev] [Proposal] Locale switching
Sent by:        [email protected]



Hi,

Now that the new message stuff is in the runtime repo I've been having
offline discussions with Dirk Fauth on how to get dynamic language
switching for the complete e4 UI.

I guess most of you know that the the low-level of our model is prepared
to make such a language switch possible at ANY level of the application
because the locale is resolved against the nearest context.

So here's our proposal to allow applications to switch the language:

a) Language switch is announced through the event-broker
b) Renderers register themselves as listeners and update the localized
   data
c) Language switching is provided to clients through
   LocaleSwitchService. A first draft looks like this:

   interface LocaleSwitchService {
      public void switchApplicationLanguage(Locale locale);
      public void switchContextLanguage(IEclipseContext c,Locale locale);
   }

I'm a bit indifferent on switchContextLanguage because I don't feel
comfortable exposing the IEclipseContext in any API and I'm uncertain
switching the language at a certain context is the 99% case. I currently
lean towards switchApplicationLanguage.

This E-Mail is just to get out the message that there's something coming
maybe in Luna, I won't do the work myself but help Dirk to accomplish
the task.

Tom
_______________________________________________
e4-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/e4-dev


_______________________________________________
e4-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/e4-dev

Reply via email to