AnsweredAssumed Answered

Allow user to change language in forms on the fly: ALF-12602

Question asked by mastro on Mar 8, 2012
I'm opening this solution to ask for help in creating a workaround for issue https://issues.alfresco.com/jira/browse/ALF-12602

This are my thought until now…

==== First Idea ====
First thing I've seen is that every form is processed by a FilteredFormProcessor

A can register a org.alfresco.repo.forms.processor.Filter to the filter registry (via spring) to change the locale on the fly while generating / persisting my form.

Since the Filter is called before and after the actual work I can use the I18NUtil.setContentLocale() to change the locale during the request and restore it back later using a thread local to store the previous value and restore it.

I can use some custom parameter in the request, but I still don't know how to inject the that parameter and how to allow the user specify the language and "remember it later"


==== Second Idea ====
Use some kind of rewrite url to change the Accept-Language HTTP header on the fly, like with an Apache server in front Alfresco Share with some prefix like en.<url>, it.<url> or maybe with the path /it/…..

A cookie may be used to remember the user preference.



I personally prefer the first idea but I would like suggestion on how to let the user modify the language (should trigger a re-load of the form).

Thanks in advance to anybody who will step in and give suggestion or elaborate my ideas.

Outcomes