Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 Internationalization

 
hoss den
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

to


or

you have change the attribute name under which the I18N Interceptor stores the Locale to Globals.LOCALE_KEY.

Best regards
Dejan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic