Hello Everybody,
If i may i would to correct the explanations given above regarding the priority between the java class and the properties files
onur otlu wrote:when Java reaches the first java class resource bundle in hierarchy during the process finding a match for a key, then Java just looks at java class resource bundles in the remaining part of hierarchy, and omits property file resource bundles.
Onur it is not totally right. The java class only hides the property file for the SAME level of the hierarchy, and not all the way to the top. After finding a java class in the hierarchy, you can still pick a property in a property file, but higher in the hierarchy.
In fact, from the matching resource bundle, java will create a hierarchy to the top, and at each level, will choose the java class over the property file, and continue the process for the parent, and so on.
To sum up, if you have a property file with the exact same name as the java class (Zoo_fr.properties, and Zoo_fr.class), the property file is useless and can never be accessed.
Consider the following example for the Locale "fr_FR", and the following files
Zoo_fr_FR.properties <== Matching resource file
Zoo_fr.class <== Direct parent of Zoo_fr_FR.properties
Zoo_fr.properties <== Hidden by Zoo_fr.class, can never be accessed
Zoo.properties <== Direct parent of Zoo_fr.class, properties are available if not overidden by a child
And the main
Thanks for reading