• 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

File naming convention for i18n Internationalization

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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??
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Darien Cheung
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for clarifying!
 
reply
    Bookmark Topic Watch Topic
  • New Topic