01: package dinamica;
02:
03: import java.util.Locale;
04: import dinamica.GenericTransaction;
05: import dinamica.Recordset;
06:
07: /**
08: * Receives a request parameter that MUST be named "locale"
09: * and set a session attribute named "dinamica.user.locale"
10: * containing a Locale object initialized with the language
11: * code (en, es, it, etc). This can be used to change the language in interactive mode.
12: * <br><br>
13: * Creation date: 10/05/2005
14: * (c) 2005 Martin Cordova<br>
15: * This code is released under the LGPL license<br>
16: * Dinamica Framework - http://www.martincordova.com<br>
17: * @author Martin Cordova (dinamica@martincordova.com)
18: */
19: public class SetLanguage extends GenericTransaction {
20:
21: public int service(Recordset inputParams) throws Throwable {
22:
23: Locale l = new Locale(inputParams.getString("locale"));
24: getSession().setAttribute("dinamica.user.locale", l);
25: super .service(inputParams);
26: return 0;
27:
28: }
29: }
|