cancel
Showing results for 
Search instead for 
Did you mean: 

WebScript message bundles [SOLVED]

andrepra
Champ in-the-making
Champ in-the-making
I'm using Alfresco 3.0
Reading wiki page http://wiki.alfresco.com/wiki/Web_Scripts#Message_Bundles i understand how to use message bundle. What I don't understand is
1. The naming convention for the other languages

<serviceId>_<locale>.<httpMethod>.properties ??
<serviceId>.<httpMethod>_<locale>.properties ??
2. How to set programatically the locale? I tried with this code in a declarative web script

I18NUtil.setLocale(new Locale(language));
but doesn't work.

Thanks
1 REPLY 1

andrepra
Champ in-the-making
Champ in-the-making
Debugging the webscript framework I've found the solution.
1. lookup <descid><language_country>.properties if fail then
2. lookup <descid><language>.properties if fail then
3. lookup <descid>.properties

where <descid> = <serviceId>.<httpMethod>

So you have to write the properties as
mywebscript.get_en.properties
mywebscript.get_it.properties


I suggest to put these lines in the AbstractWebScript class


    String language = req.getParameter("language");
    if(language != null)
       I18NUtil.setLocale(I18NUtil.parseLocale(language));

Andrea