List Info

Thread: Resolved: (STR-2077) PropertyMessageResources behaviour different from PropertyResourceBundle




Resolved: (STR-2077) PropertyMessageResources behaviour different from PropertyResourceBundle
user name
2006-11-29 12:24:58
     [ http://issues.apache.org/struts/browse/STR-2077?page=all
 ]

Niall Pemberton resolved STR-2077.
----------------------------------

    Fix Version/s: 1.3.6
       Resolution: Fixed
         Assignee: Niall Pemberton  (was: Struts Developers)

I have added a "compatibility mode" configuration
option to PropertyMessageResources. It can now be configured
to operate in one of three modes:

1) "Default" mode - default, backwardly
compatible, Struts behaviour (i.e. the way its always
worked).
2) "JSTL" mode - compatible with how JSTL finds
messages (fixes STR-2925)
3) "Resource" mode - compatible with how Java's
<code>PropertyResourceBundle</code>  finds
messages (fixes STR-2077)

To configure for "JSTL" mode:

    <message-resources
parameter="mypackage.MyMessageResources">
        <set-property key="mode"
value="JSTL"/>
    <message-resources>

To configure for "Resource" mode:

    <message-resources
parameter="mypackage.MyMessageResources">
        <set-property key="mode"
value="resource"/>
    <message-resources>

http://svn.apache.org/viewvc?view=rev&revision=4805
49

> PropertyMessageResources behaviour different from
PropertyResourceBundle
>
------------------------------------------------------------
------------
>
>                 Key: STR-2077
>                 URL: http:
//issues.apache.org/struts/browse/STR-2077
>             Project: Struts 1
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.1 Final
>         Environment: Operating System: All
> Platform: All
>            Reporter: Alexander Daryin
>         Assigned To: Niall Pemberton
>            Priority: Minor
>             Fix For: 1.3.6
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators: http://issues.apache.org/struts/secure/Administrators.
jspa
-
For more information on JIRA, see: http://www.atl
assian.com/software/jira

        
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )