Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Properties Vs ResourceBundle

 
aryan sanghvi
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Properties file:
Properties file stores information about the characteristics of a program or environment including internationalization/localization information.
file.properties and java.util.properties ..what is the relation.??


eg:
greetings = Hello
farewell = Goodbye
inquiry = How are you?



What is a Resource Bundle?

message = ResourceBundle.getBundle("MessagesBundle",
currentLocale);

A resource bundle is essentially one or more Java "properties" files.
ResourceBundle objects contain locale-specific objects. You use ResourceBundle objects to isolate locale-sensitive data, such as translatable text. In the sample program the ResourceBundle is backed by the properties files that contain the message text we want to display.

Can you please clarify Resource bundle & Properties file..difference and usage.
 
Tom Adams
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The thing resource bundles bring to the party is the ability to have the Java libs determine which is the best property file for a given locale. With a property file you need to load a specific name...with a resource file you use:



And Java figures out to use a MyResources_de_CH.properties or something else...

HTH
Tom
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic