• Post Reply Bookmark Topic Watch Topic
  • New Topic

ResourceBundle not using Locale  RSS feed

 
todd runstein
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what I'm doing wrong - this seems very straightforward. I have simple internationalization code and I'm trying to override the Locale being used. However, using the PropertyResourceBundle.getBundle(String, Locale), the Locale seems to be ignored.

Here's the test class:


Here's the TextLabel class:


Pretty straightforward. However, the output generated is:
Locale = en_US
Bundle using
Locale = en_US
Bundle using
Locale = en_US
Bundle using fr_CA

I would expect the last one to say "Bundle using en_US". I'm running the test inside Eclipse 3.3.0 using Sun's 1.5.0.13 JVM. Any ideas why the Locale is being ignored?

Thanks in advance!
 
todd runstein
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I solved it. I had 2 properties files: Text_Labels.properties and Text_Labels_fr_CA.properties. Simply adding a file named Text_Labels_en.properties (which matches Text_Labels.properties) fixes the problem!
 
Bert Bates
author
Sheriff
Posts: 8954
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just so that everyone gets the idea, let's slide this (probably already finished) thread over to the intermediae forum.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!