struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Benedict (JIRA)" <j...@apache.org>
Subject [jira] Updated: (STR-2351) consider second languages in accept-language header
Date Tue, 03 Jul 2007 03:24:26 GMT

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

Paul Benedict updated STR-2351:
-------------------------------

    Fix Version/s: 1.4.0
         Assignee:     (was: Struts Developers)

> consider second languages in accept-language header
> ---------------------------------------------------
>
>                 Key: STR-2351
>                 URL: https://issues.apache.org/struts/browse/STR-2351
>             Project: Struts 1
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.2.4
>         Environment: Operating System: Linux
> Platform: All
>            Reporter: Jeroen Kransen
>            Priority: Minor
>             Fix For: 1.4.0
>
>
> I noticed the strong support for different locales by struts, which I
> like very much. There is however one thing I am missing. Imagine that my
> preferred language as set in the "Accept-language" setting of my browser
> (and HTTP header in requests) is: "fr,de" (French and German
> respectively). If I go to a Struts site that supports only English and
> German (en,de), there is no match at all, no matter that I accept
> German. Reason is the following lines in RequestUtils.java:
>       if (userLocale == null) {
>           // Returns Locale based on Accept-Language header or the
> server default
>           userLocale = request.getLocale();
>       }
> So, only the (first) preferred language is considered, and any
> successive languages are discarded. According to the HTTP specs, it can
> be a list of languages ("nl,en;q=0.8,de;q=0.5,..."). This is why the
> HttpServletRequest also has a method getLocales() which returns an
> Enumeration. I would like it if Struts would try to match any of the
> successive languages for which .properties files exist if the first
> isn't matched. I realize that it may cause a performance penalty, so
> maybe it can be made a configuration option
> (match-second-languages=true/false or something).
> I hope you will consider to add this feature.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message