Re: How to get the current language from a webapp ?

Serge Huber <[email protected]>
Newsgroups gmane.comp.cms.jahia.template
Message-ID <[email protected]>
Hi Olivier,

You are perfectly right about the Jahia Beans not be accessible through 
context barriers, but I was not talking about getLocale() on the 
ParamBean object but on the HttpServletRequest object. If you look at 
our wrapper, behind the scenes it does a call to ParamBean.getLocale(). 
So in effect :

HttpServletRequest.getLocales() -> 
HttpServletRequestWrapper.getLocales() -> 
ServletIncludeRequestWrapper.getLocales() -> ParamBean.getLocales()

Regards,
  Serge Huber.

Olivier Vit wrote:

> Hello Serge,
>
> Thanks for your feedback.
>
> I know that jParams.getLocale() would give this data
> But my understanding is that the Jahia beans are not accessible from 
> the context of a webapp, but only the few session variables defined in 
> http://cvspub.jahia.org/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/services/applications/ServletIncludeRequestWrapper.java 
>
>
> Am I wrong ?
> Regards,
>
> Olivier
>
> Serge Huber wrote:
>
>>
>> Hi Olivier,
>>
>> You should be able to get this information from the getLocale() method.
>>
>> Regards,
>>  Serge Huber.
>>
>> Olivier Vit wrote:
>>
>>> Hi
>>>
>>> I'm building a small webapp to display content extracted from a 
>>> legacy database. Depending on the language of the page currently 
>>> displayed by Jahia, labels and content should be customized to the 
>>> same language.
>>>
>>> It looks that 
>>> org\jahia\services\applications\ServletIncludeRequestWrapper.java 
>>> does set a few session values made available to web-apps running 
>>> within Jahia as a portlet, but I can't see any that would give the 
>>> information of the language of the current page.
>>>
>>> Is there any other manner to get this language info ?
>>>
>>> Thanks for your help
>>>
>>>
>>>
>>>
>>
>>
>>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.