• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

locale setting through code

 
Puneetx Gupta
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am in process of developing a multilingual website.
Struts support multilingual developement with different resource file. I am able to implement that successfully.
But the above implementation reads the locale setting from the browser setting.
I need to change the language of the website on the click of a link.
to implement this i should be able to change the locale setting through code.
Kindly guide me to achieve the same?
Is it possible that i extend some class and set the locale variable thorugh there? or through some configuration setting in struts framework will get the value of locale variable from some user defined variable?

Any help is appreciated.
Puneet Gupta
puneetjunk@rediffmail.com
 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi puneet

See the struts stores the locale in session when the session is created ..........and it wont update the same for every request ....it will update only when the new session is created tgatswhy if uc lose the browser and opena new browser the language change will get effected ...

so if u want that to be changed immedaitely u want to over ride the RequestProcessor provided by struts and especailly u should override the processLocale method ....in that u should get the locale from the request and update the session varible everytime


This will solve ur problem
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic