wood burning stoves 2.0*
The moose likes Struts and the fly likes Question on i18n Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Question on i18n" Watch "Question on i18n" New topic
Author

Question on i18n

Xavier George
Ranch Hand

Joined: Jul 29, 2005
Posts: 39
I need to know how to generate message in jsp from specific ApplicationResources property file. In other words, when I write <bean:message key="app.hello" />. How to instruct JSP to call app.hello from German/French/Italian ApplicationResources_xx.properties. Below is my 3 properties file

The German ApplicationResources_de.properties file.
app.name=Name
app.hello=Hallo

The French ApplicationResources_fr.properties file.
app.name=Nom
app.hello=Bonjour

The Italian ApplicationResources_it.properties file.
app.name=Nome
app.hello=Ciao

Do I need to creat locale object in JSP based on user selection of specific country or do I need to populate specific locale object in the request object?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
You set a locale object in the HttpSession. The Struts Action class that is the superclass for your action class has a method setLocale() that will accomplish this.


Merrill
Consultant, Sima Solutions
Xavier George
Ranch Hand

Joined: Jul 29, 2005
Posts: 39
Thanks for your response. Thats what I was thinking.
Nyanas Kandhan
Ranch Hand

Joined: Jan 27, 2009
Posts: 35
For an example on Struts internationalization you can refer here.

Struts I18N using locale.
Struts Internationalization using browser settings.

regards
Struts Developer


regards,
Nyanaskandhan
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

That was a two-year old finished thread--why are you doing this?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question on i18n