File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
ramana reddy B.V
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
gunjan bohra
Ranch Hand
Posts: 40
 
alan do
Ranch Hand
Posts: 354
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
rajani arjun
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

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

thanks
Rajani
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic