Issue Details (XML | Word | Printable)

Key: STR-2077
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Niall Pemberton
Reporter: Alexander Daryin
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Struts 1

PropertyMessageResources behaviour different from PropertyResourceBundle

Created: 25/May/04 03:19 PM   Updated: 20/Aug/07 09:42 AM
Return to search
Component/s: Core
Affects Version/s: 1.1.0
Fix Version/s: 1.3.6

Environment:
Operating System: All
Platform: All
Issue Links:
Duplicate
 

Bugzilla Id: 29197


 Description  « Hide
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.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order