Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Properties Vs ResourceBundle

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic