• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question on i18n

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Xavier George
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your response. Thats what I was thinking.
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For an example on Struts internationalization you can refer here.

Struts I18N using locale.
Struts Internationalization using browser settings.

regards
Struts Developer
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That was a two-year old finished thread--why are you doing this?
reply
    Bookmark Topic Watch Topic
  • New Topic