Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Internationalization Issue

 
Sailesh Ganeshan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I've an issue with struts internationalization. Let me give you a quick description of the problem:

I need to show a country specific content on my website, which happens to be for US. Hence, I've created a resource file ' MyResource_en_US.properties'. Similarly, I've to show a different content for other countries, which I'm managing in the resource file: 'MyResources.properties'.

However, the issue is the system always looks up the content from en_US file irrespective of my country. This could possibly be because, the default locale is en_US. Is there any way to force change this default locale, so that 'MyResources.properties' is preferred for countries other than US ?

I've however, corrected the issue, by passing request_locale as parameter in the URL. But, I'd prefer it to have this configurable, rather than URL driven!

Rgds,
Sailesh
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you go through default.properties in struts-core jar file the default local configuration is

You can change the default configuration in two ways one way is override the value in struts.properties or else add constant in struts.xml file
 
Sanjeev Kumar Ramineni
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please refer to the link below. This might solve your problem.

http://www.vaannila.com/struts/struts-example/struts-i18n-example-1.html.

Regards,
Sanjeev.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic