File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes File naming convention for i18n Internationalization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "File naming convention for i18n Internationalization" Watch "File naming convention for i18n Internationalization" New topic
Author

File naming convention for i18n Internationalization

Darien Cheung
Ranch Hand

Joined: Aug 13, 2004
Posts: 36
I'm using Struts 1.2, JSP 2.0 and Tomcat 5.5. Does the message resource bundle file name have to follow the convention "bundlename_language_country.properties"? I find that some examples such as on apache.org simply use "bundlename_xx.properties" but when I use that naming convention, my messages are not formatted, instead I get the usual ??US_keyname??
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The way it works is this:

1-bundlename.properties (no suffix) is the defult, and is used if there is no match to language or country.

2-If you specify bundlename_xx where xx is a two-character language code, this bundle will match all locales that use that language.

3-If you specify bundlename_xx_YY where xx is a language code and YY is a country code, The bundle must match both the language and the country of the user's locale.

4-if you specify bundlename_yy where yy is a country code, it will not work.
[ September 12, 2006: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
Darien Cheung
Ranch Hand

Joined: Aug 13, 2004
Posts: 36
Thanks for clarifying!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File naming convention for i18n Internationalization