You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Debraj Mallick <sr...@gmail.com> on 2011/09/24 15:13:08 UTC

i18n language setting

hi,

i need to set language form action, if i set "struts.locale = du_NL"
in struts.properties then dutch will the default language.
how can i set language from action, i have tried using

session.put("WW_TRANS_I18N_LOCALE", "du_NL");
and
locale = new Locale("du");
ActionContext.getContext().setLocale(locale);


but all these does not work. any suggestion would be appreciated.


Thanks & Regards,
Debraj Mallick
9674247281

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: i18n language setting

Posted by Carl Ballantyne <ca...@gmail.com>.
I think you can pass request_locale via the URL. So
index.action?request_locale=du_NL. I think this will then keep in in the
session until you change it.

Check out http://struts.apache.org/2.x/docs/faqs.html - localization
section. In particular
http://struts.apache.org/2.x/docs/how-do-we-change-locales.html.



On Sat, Sep 24, 2011 at 3:13 PM, Debraj Mallick
<sr...@gmail.com>wrote:

> hi,
>
> i need to set language form action, if i set "struts.locale = du_NL"
> in struts.properties then dutch will the default language.
> how can i set language from action, i have tried using
>
> session.put("WW_TRANS_I18N_LOCALE", "du_NL");
> and
> locale = new Locale("du");
> ActionContext.getContext().setLocale(locale);
>
>
> but all these does not work. any suggestion would be appreciated.
>
>
> Thanks & Regards,
> Debraj Mallick
> 9674247281
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>