Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [e4-dev] [Proposal] Locale switching

Hi,

Yeah i know about LocaleProvider but have never used it myself. I also
think its going to be hard to implement what our current translation
system can do (e.g. we can switch the locale only for a certain area of
the application, ...).

If I get LocaleProvider right i would have to inspect the call-stack to
find out where from I am called, to me this service looks like it is
e.g. designed for systems like RAP where the have a "thread-local" to
store the locale for each instance.

What we can do although is to inform the LocaleProvider (in case there
is one) about the language change.

On the injection story: Clients can already today let themselves inject
the locale because we are pushing it into the IEclipseContext, the
problem for the renderes is that they problem won't get an injection
when the user does not flip the whole application but e.g. the Java
perspective.

The renderers are bound to the application context and so won't get
notified.

Tom

On 20.11.13 17:21, John Arthorne wrote:
> 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 <tom.schindl@xxxxxxxxxxxxxxx>
> To:        E4 Project developer mailing list <e4-dev@xxxxxxxxxxx>,
> Date:        11/19/2013 06:31 PM
> Subject:        [e4-dev] [Proposal] Locale switching
> Sent by:        e4-dev-bounces@xxxxxxxxxxx
> ------------------------------------------------------------------------
> 
> 
> 
> 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
> e4-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/e4-dev
> 
> 
> 
> 
> _______________________________________________
> e4-dev mailing list
> e4-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/e4-dev
> 



Back to the top