• Post Reply Bookmark Topic Watch Topic
  • New Topic

Internationalization : Property vs Resource Bundle?

 
Dom Miller
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

Could someone help clear up my confusion on thes two items pls?

ResourceBundle : Contains locale specific objects

Property : Contains localisation parameters that the app loads at boot time.

Could someone give me an examples of each.

I always understood a property to contain the text translations, eg greeting=hello, but the examples seem to have the resource bundle doing this.

Is a ResourceBundle used to pull in a group of .properties files?

Many thanks,
Dom
 
Deepak Pant
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quick 2 cents:

(a) Properties file is a collection of name/value pairs. Properties object when loaded provides you with methods to access the name/value pairs. The location of the property file is kind-of hardcoded in the program.

(b) ResourceBundle is a much more sophisticated method of loading the properties files using the locale and the classpath. For example: If you have a property file called MyMessages.properties then ResourceBundle will allow you to load MyMessages.properties (default) or MyMessages_jp.properties for Japan or MyMessages_fr.properties for France etc.
 
Dom Miller
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Deepak - think I've got it now!
 
It runs on an internal combustion engine. This ad does not:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!