cancel
Showing results for 
Search instead for 
Did you mean: 

WebScript and Multi Language

kma
Champ in-the-making
Champ in-the-making
Hi,

A question about multi language and webscripts:

1) As far as I understand the language is taken from
    the browsers setting when a webscript is invoked.
    I our case the users can select a language on the page
    and we don't want to use  the browser setting. 
    Is there any way where we  can set the language ?
    One option is to configure a java bean into the webscript
    and basically call
    I18NUtil.setLocale(locale). Is there any other options ?

2) Freemarker templates and multi language, how do I access
    multi language content in Freemarker templates.  If locale
    is set and I have ML content I would expect it picked up
    the correct language content. It seems not to be the case.
    Any idea/hint.

Thanks,
Karsten
1 REPLY 1

davidc
Star Contributor
Star Contributor
Actually, web scripts are not sensitive to the browser locale.  It's something we're considering.

So, the only way today to alter the run-time locale is to build your own derivation of DeclarativeWebScript/AbstractWebScript that calls I18NUtil.setLocale (and clears it again) for each request.

The Freemarker templates should operate as normal - call message(messageId) as described by http://wiki.alfresco.com/wiki/Template_Guide#Default_Model_Methods