File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Question on i18n" Watch "Question on i18n" New topic

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 Below is my 3 properties file

The German file.

The French file.

The Italian file.

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.

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.

Struts Developer

David Newton

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:
subject: Question on i18n
It's not a secret anymore!