Hello,
Thanks for your answer. The problem is that I can only retrieve the language of the user currently calling the webservice.
In my case I want to trigger an email to someone else based on the preferred language of that other person.
I ended up with a somewhat similar solution. Every time a user connect to my webservice I retrieve headers["accept-language"] and store it in person.properties["preferenceValues"] .
That property is a json so I can just add my custom property in here.
Then once it's linked to the user node, I can access it whenever I want.
But there must already be a language associated with the user profile since Alfresco explorer interface manage to remember the user preferred language entered in his profile. It just doesn't seen to be exposed via javascript.