Professional Documents
Culture Documents
html
The ResourceBundle class has two subclasses called PropertyResourceBundle and ListResourceBundle.
All interaction with these two subclasses goes through the ResourceBundle class.
Creating a ResourceBundle
You never create ResourceBundle instance directly, but an instance of one of its two subclasses.
First the ResourceBundle class will look for a ListResourceBundle, and then for a PropertyResource
Bundle.
It does so by matching the name of the requested resource bundle (first parameter in the getBundle()
method) against the class names of a ListResourceBundle or a property file resource bundle.
OUTPUT:
EUR This is not localized is 3
Conclusion:
{0} is first field of messageArguments[]
{1} is second field of messageArguments[] and so on.
messageArguments[] can have more fields than actual message.
Notice, messages present in PropertyResourceBundle or ListResourceBundle can be localized. Argument
passed from java-code (i.e. messageArguments) can’t be localized. Because we have presentation of
Property/List ResourceBundle in different languages in the form of Choice_en_US.properties or
Choice_fr_FR.properties. Argument passed can’t have such corresponding local representation.
So if something need to be localized then it need to be removed from argument and put into property
or list files.