You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2004/05/25 10:19:24 UTC

DO NOT REPLY [Bug 29197] New: - PropertyMessageResources behaviour different from PropertyResourceBundle

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29197>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29197

PropertyMessageResources behaviour different from PropertyResourceBundle

           Summary: PropertyMessageResources behaviour different from
                    PropertyResourceBundle
           Product: Struts
           Version: 1.1 Final
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Utilities
        AssignedTo: dev@struts.apache.org
        ReportedBy: daryin@wdc.ru


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.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org