Internationalization in struts application

Hi,

I am trying to implement the multilingual in my struts application.I have done it successfully through browser setting.Now I want to select a language on my login page through drop down and then application should be opened in the choosen language. i.e. i want to change the locale through code.

Can anybody suggest me what to do?

[354 byte] By [multilinguala] at [2007-10-1 20:22:46]
# 1

create a property in your form bean for user_locale, and an html:select in your jsp, in my example the values of the select are locale strings ie "en_US".

here's the action code

LogonForm logonForm = (LogonForm) form;

Locale newLocale=new Locale(((LogonForm)form).getUser_locale().substring(0,2),((LogonForm)form).getUser_locale().substring(3,5));

HttpSession sess = request.getSession(false);

sess.setAttribute(Globals.LOCALE_KEY,newLocale);

HTH

omri_fa at 2007-7-13 2:23:20 > top of Java-index,Desktop,I18N...