Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [e4-dev] TranslationService and Locale in wrong context

Hi,

I'm +1 on moving the service to the application context this where it
should have been put since day 1.

Just one note on multi-instance envs:
-------------------------------------
While thinking about this I remembered that this impacts the
TranslationObjectSupplier which currently is building on OSGi-Singletons.

IMHO there's a design flaw in the ExtendedObjectSupplier system (in
already pointed this out to Oleg by then) in conjunction with multi-user
envs in general because it is bound to the intial APPLICATION-CONTEXT it
is created on - now imagine this first app goes down!

Tom

On 03.12.13 11:52, Dirk Fauth wrote:
> Hi,
> 
> on implementing the Locale change for the application model I came
> across something.
> 
> The current set Locale and the TranslationService are put in the OSGi
> context. By discussing this fact with Tom Schindl, this is
> 
> 1. a implementation detail
> 2. not intended
> 
> Usually only ExtendedObjectSupplier will get in touch with the OSGi context.
> 
> 
> What is the downside of having the TranslationService in the OSGi context?
> 
> On implementing the Locale change we specified that it should be
> possible to specify in which context to change the Locale. Usually it
> should be the application context, as users usually want to change the
> localization of the whole application. (changing the Locale of all
> running OSGi applications that have access to the OSGi context is
> usually not intended).
> 
> Now if I set the new Locale in the application context, the
> TranslationService is not informed about that change, and therefore the
> application model is not re-localized.
> 
> 
> What would be the necessary changes?
> 
> It should be a simple change in code. In E4Application the Locale and
> the TranslationService are put into the service context in
> createDefaultHeadlessContext(). This should be moved to
> createDefaultContext() and put into the application context.
> 
> A simple change in code that might have some impact I'm not quite sure
> about. So here's the question to the E4 experts:
> 
> Should I perform and contribute the change to put the TranslationService
> and the Locale into the application context?
> 
> Greez,
> Dirk
> 
> 
> _______________________________________________
> e4-dev mailing list
> e4-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/e4-dev
> 



Back to the top