Hi Using i18n is a very simple in struts. Lets make a sample application to say hello to the Rock.
Steps to do i18n:- 1. Create a test application. 2. index.jsp would be like this:- <[EMAIL PROTECTED] language="java"%> <[EMAIL PROTECTED] uri="/WEB-INF/struts-html.tld" prefix="html"%> <[EMAIL PROTECTED] uri="/WEB-INF/struts-bean.tld" prefix="bean"%> <html> <head> <title>Struts i18 test</title> </head> <body> <bean:message key="welcome.message"/> Rock!!! <hr> <%= "Current Locale: " + request.getLocale () %> </body> </html> 3. Rename the ApplicationResources.properties to the locale you required. Suppose your current locale is en_US. So, rename it to ApplicationResources_en_US.properties. 4. Copy this file and paste it in the same folder and rename it to another locale you want the support for your application. Suppose french. So, it would be ApplicationResources_fr_FR.properties. 5. Now you have two properties files in your application. A) ApplicationResources_en_US.properties. B) ApplicationResources_fr_FR.properties. 6. Now add a message to ApplicationResources_en_US.properties file. welcome.message=Hello 7. Now add a message to ApplicationResources_fr_FR.properties file. welcome.message=Bonjour That's it. Now create a WAR file and deploy it on the server. Check it, if everything is right then it would print "Hello Rock!!!". Now to test the french locale, go to settings of IE and choose option language. Add a language "fr-FR" and move it up in the list. Refresh the page and new message would be "Bonjour Rock!!!". It's done dude:jumping: Mirbek Nosinov wrote: > > Hello > > How can i implements internationalization features in struts 2 > application. > i am using struts 2.0.9 and my user interface based on tiles 2. > > How can i switch from one language to another with different locale? > > Thanks in advanced. > > http://www.nabble.com/file/p12588059/i18n_test.war i18n_test.war http://www.nabble.com/file/p12588059/i18n_test.war i18n_test.war -- View this message in context: http://www.nabble.com/i18n-in-struts2-tf4412314.html#a12588059 Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]