File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts2 Internationalization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 Internationalization" Watch "Struts2 Internationalization" New topic

Struts2 Internationalization

hoss den

Joined: May 06, 2011
Posts: 1
Hello guys, and sorry for my bad english.

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
Dejan Lazovic

Joined: May 11, 2011
Posts: 3
Hello hoss,

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.

Best regards
I agree. Here's the link:
subject: Struts2 Internationalization
It's not a secret anymore!