Regarding Struts Internationalization
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   upendar_mankena
Posted On:   Monday, September 10, 2007 03:11 AM

Hi,

I am working on struts internationalization, my application is , i want to take one combo box in login jsp page,that combo box having two languages English and French, if i have to select french from the combo box that login page and other jsp pages also converted into french language, if i ahve to select english language, that login page and other jsp pages also converted into english language.

Plz advice me . Plz send me the example code...

Re: Regarding Struts Internationalization

Posted By:   Anonymous  
Posted On:   Friday, November 30, 2007 04:29 AM

First step for this is to make the resource bundle and the next thing have to do is to set the Locale in the action class according to the language selected then struts automatically load the corresponding resource bundle

Re: Regarding Struts Internationalization

Posted By:   darryl_culverwell  
Posted On:   Wednesday, October 31, 2007 08:58 AM

Hi,

You can create a resource bundle file (In this case GlobalResources_en_US.properties).

You need to append the locale before the .properties
Then you can reference this in your struts-config.xml file without any locale :





Whey you want to get a specific message from your bundle, get the resource bundle :

MessageResources resourceBundle = (MessageResources) request.getAttribute("org.apache.struts.action.MESSAGE");
resourceBundle.getMessage({CHOOSEN LOCALE}, "a.message.key");


Hope this helps
About | Sitemap | Contact