|
It is stated in the javadoc of PropertyMessageResources that it "reads message
keys and corresponding strings from named property resources in the same manner
that <code>java.util.PropertyResourceBundle</code> does."
[Property]ResourceBundle defines the following order of traversal:
baseName + "_" + language1 + "_" + country1 + "_" + variant1
baseName + "_" + language1 + "_" + country1
baseName + "_" + language1
baseName + "_" + language2 + "_" + country2 + "_" + variant2
baseName + "_" + language2 + "_" + country2
baseName + "_" + language2
baseName
(1 is user locale, 2 is default locale)
In fact, PropertyMessageResources tries these keys:
baseName + "_" + language1 + "_" + country1 + "_" + variant1
baseName + "_" + language1 + "_" + country1
baseName + "_" + language1
baseName + "_" + default locale
baseName
This causes serious problems with localization.
Example:
I have the following localizations:
resources.properties - default strings (English)
resources_ru.properties - localization to Russian
Default locale is ru_RU (Russian, Russia). A client connects with locale uk
(Ukrainian). As far as there is no Ukrainian localization, I expect that he
will see messages in Russian. But since there is no localization to ru_RU, he
gets messages in English, which is inacceptible.
|