• 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

How to implement struts internationalization by taking the language locale from the

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

At present i'm developing a project in which i'm having the following requirement. In my project i need to disply the labels and messages in different languages based on the users preffered language.I am getting user's language from the database when he/she is logged in. Then i hav to display the messages in corresponding languages.

Please any one could suggest the solution.

regards
ramana
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
read this
http://www.javaworld.com/javaworld/jw-05-2004/jw-0524-i18n.html
 
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this article is useful, but doesn't cover enough re: struts internationalization. here's a better one...
http://www.allapplabs.com/struts/struts_internationalization.htm

your case needs a few additional steps...
1. you need to manually set the locale explicitly (using Filter or extend the ActionServlet or something else - if there's a single entry point in your app, then you can call this inside your Action) by


2. your html template should have <html:html locale="true">

3. if you use JSTL fmt:message instead of bean:message , you'll need to have this as well
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

localeFromDB what your talking what should be the format give one example

thanks
Rajani
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What Alan is referring to here is a java.util.Locale object. As you can see from the javadoc, it has constructors that accept either just a language code, or a language code and a country code.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic