• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts2 Internationalization

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic