[Yanel-dev] Language handler and i18n

Josias Thöny josias.thoeny at wyona.com
Fri May 2 17:35:16 CEST 2008


Michael Wechner wrote:
> Michael Wechner wrote:
> 
>> Hi
>>
>> If I remember correctly we have introduced the language handler in 
>> order to allow overwriting the way how i18n is getting the required 
>> language, because the i18n component is using by default the 
>> localization (instead the content language).
>>
>> The problem with this it seems to me is that by setting the language 
>> handler the localization is being o overwritten for all cases not just 
>> the i18n.
>>
>> So, I would like to suggest to enhance the i18n configuration by 
>> attaching the language handler to i18n directly, for example
>>
>>  <i18n-catalogue 
>> language-handler-class="org.wyona.yanel.impl.StaticLanguageHandler">yanelrepo:/app/globus-i18n.xml</i18n-catalogue> 
>>
>>
>> instead
>>
>> <language-handler class="org.wyona.yanel.impl.StaticLanguageHandler"/>
>>  <i18n-catalogue>yanelrepo:/app/globus-i18n.xml</i18n-catalogue>
>>
>> WDYT?

Maybe it should rather be
<i18n-config>
   <language-handler class="org.wyona.yanel.impl.StaticLanguageHandler"/>
   <i18n-catalogue>yanelrepo:/app/globus-i18n.xml</i18n-catalogue>
</i18n-config>

Because the language handler does not really belong to the catalogue, 
and also because there may be several catalogues: the global one, a 
realm specific one, and a rt specific one (optionally).

Another possibility would be to configure whether the i18n uses the 
content language or the localiztion language:
<i18n-config>
   <language type="CONTENT"/>
</i18n-config>
or
<i18n-config>
   <language type="LOCALIZATION"/>
</i18n-config>

or something like that.

IIRC my original intention with the language handler was that one could 
override the behaviour how the localization language is determined 
(considering http headers, session, user profile, defaults, etc.)
I think the usage of this is not really limited to i18n. But I admit 
that the DefaultLanguageHandler which returns the content language as 
localization language is a bit weird.

Josias

> 
> 
> has anyone an opinion on this?
> 
> Thanks
> 
> Michi
> 
>>
>> Thanks
>>
>> Michi
>>
> 
> 



More information about the Yanel-development mailing list