Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help on struts I18N

 
sandeepamarnath sandeepamarnath
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Im sandeep,
Im using struts 1.1 I18N and i want to internationalize the dynamic data i.e. i want to print the data from the database in different languages.
can any one help
Thanks in advance
 
Aniruddh Joshi
Ranch Hand
Posts: 275
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
you can do this using multiple ApplicationResource files (Resource Bundles).You need the ISO codes for the languages , using them create your resource bundles with names ApplicationReaource_xx whre 'xx' is the ISO code for the language.
The keys in all the files will be the same and the values will give you language specific messages.
Then configure them in web.xml file as shown :

<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param> <param-name>application</param-name>
<param-value>ApplicationResources_xx</param-value>
<param-value>ApplicationResources_xy</param-value>
<param-value>ApplicationResources_xz</param-value>
.
.
.
</init-param>
</servlet>

I think above code will do the job.
[ July 30, 2008: Message edited by: Aniruddh Joshi ]
 
kademane guru
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sandeepamarnath sandeepamarnath:
HI Im sandeep,
Im using struts 1.1 I18N and i want to internationalize the dynamic data i.e. i want to print the data from the database in different languages.
can any one help
Thanks in advance


Hi Sandeep,
I am doing i18N using struts. In my project i want to display the static text which is there in JSP page in different language. please help me how to suceed in this?. And here how i should set the locale key for different language(i shouldn't set the locale in browser).

Looking forward from you.

Regards
Gururaja.k
 
Nyanas Kandhan
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use this method for displaying static data in different languages. For an example on Struts internationalization you can refer here.

Struts I18N using locale.
Struts Internationalization using browser settings.

regards
Struts Developer
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic