Hi,

Yes, you can just inject Request and PersistentLocale.

-Filip

Ulrich Stärk skrev:
In order to have localized Translators, Howard suggested to override the default TranslatorSource service and add my own Translators to it. If I want to have localized Translators I have to take into account the Request's current locale and the locale that might have been set in the PersistentLocale Service which can be different for different users. But the TranslatorSource is a singleton object so I'd either have to construct a new Translator for every incoming request or construct a set of Translators for every supported locale at startup, in both cases provided I can inject Request and PersistentLocale into my service.

My two questions are:

Is the way I outlined the only way to get localized Translators or do you have a better idea?

Can I just inject Request and PersistentLocale into my overriding TranslatorSource service and have access to the Request's respectively PersistentLocale's locale?

TIA,

Uli

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to