struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Lenart (JIRA)" <j...@apache.org>
Subject [jira] Updated: (WW-3219) Fallback locale mecanism is broken and highly dependent on Locale.getDefault()
Date Sat, 10 Apr 2010 13:53:41 GMT

     [ https://issues.apache.org/jira/browse/WW-3219?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Lukasz Lenart updated WW-3219:
------------------------------

    Fix Version/s: Future
                       (was: 2.2.0)

Workaround exists, use of JDK 6 isn't an option and implementing own getBundle mechanism is
a huge task, moving to future.

> Fallback locale mecanism is broken and highly dependent on Locale.getDefault()
> ------------------------------------------------------------------------------
>
>                 Key: WW-3219
>                 URL: https://issues.apache.org/jira/browse/WW-3219
>             Project: Struts 2
>          Issue Type: Improvement
>    Affects Versions: 2.1.8
>         Environment: French JVM
>            Reporter: Julien HENRY
>            Priority: Minor
>             Fix For: Future
>
>
> If I have 2 resource bundles:
> messages_fr.properties
> messages.properties (containing en_US)
> and my JVM is a French one (Locale.getDefault()=fr_FR)
> then struts will always use messages_fr.properties whatever is the parameter used for
struts.locale or request_locale (even if I explicitly require en_US).
> This is because of the standard ResourceBundle.getBundle() lookup algorithm.
> http://java.sun.com/j2se/1.4.2/docs/api/java/util/ResourceBundle.html#getBundle(java.lang.String,%20java.util.Locale,%20java.lang.ClassLoader)
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5086301
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4303146
> Potential solutions:
> 1) Use new JDK 1.6 feature: ResourceBundle.Control to specify the fallback Locale
> 2) Don't use getBundle and implement your own resource bundle lookup mecanism like in
JSF

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

        

Mime
View raw message