I have a web application that need to be internationalized in Struts2. I'm new in Struts2.
In Struts I have no problems with it, because my LocaleAction does everything for me and puts the Globale.LOCALE_KEY in session for the future use.
My LocaleAction from Struts:
But in Struts2 there is a big problem with this, and I don't know how to handle it, after I choose the language I need (ex: French), Action changes it, but if I go to another page, the locales resets to it's default (ex: English).
In Struts2 I am trying to do something like in Struts, but without success, this is my code:
I need a little help please
Joined: May 11, 2011
I'm new to Struts2 myself, but maybe I can help. The default session key under which the I18n Interceptor looks up the current Locale is WW_TRANS_I18N_LOCALE (I18N Javadoc).
So you have to either change
you have change the attribute name under which the I18N Interceptor stores the Locale to Globals.LOCALE_KEY.