This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes getting Properties file in MessageBundle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "getting Properties file in MessageBundle" Watch "getting Properties file in MessageBundle" New topic
Author

getting Properties file in MessageBundle

Chiranjeevi Kanthraj
Ranch Hand

Joined: Feb 18, 2008
Posts: 288

hi all
This is my code

and i am getting the Error


Please tell me how can i give the Base name parameter to the getBundle() method.
And my MessageBundle with all Locale is present in the same directory.
Thanks


-Chiru
Lance Miller
Greenhorn

Joined: Jun 23, 2008
Posts: 21
The getBundle() method will look for the desired resource bundle on the classpath. In this case, since the locale you are passing in is "en_US", and you are using "MessageBundle" for the baseName, it searches the classpath for the file "MessageBundle_en_US.properties". If it can't find that file, it will look for a file name "MessageBundle_en.properties". Finally, if it can't find that file, it will search for the default file of "MessageBundle.properties"

Check to make sure your resource bundles are on your classpath or that you are specifying their location as part of the classpath. That is most likely the issue. Also take a look at the Java Tutorial on Resource Bundles Usage.
[ July 21, 2008: Message edited by: Lance Miller ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting Properties file in MessageBundle
 
Similar Threads
Internationalization
internationalization help!
Help with I18N
ResourceBundle.getBundle
ItemStateChanged Event