cancel
Showing results for 
Search instead for 
Did you mean: 

Language variable inside webscripts

msvoren
Champ in-the-making
Champ in-the-making
Hi,
Is it possible to reach language setting from a webscript?

When logging to alfresco, you pick a language, then it can be accessed inside JSP with:

FacesContext fc = FacesContext.getCurrentInstance();
String selectedLanguage = String.valueOf(Application.getLanguage(fc));

Can I, somehow, get this information inside webscript?

Any way to include this piece of JSP in FTL ?
1 REPLY 1

msvoren
Champ in-the-making
Champ in-the-making
Found out a work-around.

Create bundles for each language:
test.get_hr_HR.properties
test.get_it_IT.properties

then, in each language file create a "langauge" message:
language=it_IT
  (in test.get_it_IT.properties)
and
language=hr_HR
   (in test.get_it_IT.properties)

Then, inside test.get.ftl write a following command:
Language: ${msg("language")}

and you have your language property inside a webscript context Smiley Happy

Maybe there's an easier way to do this?