cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sjur N. Moshagen (JIRA)" <>
Subject [jira] Commented: (COCOON-1369) LocaleMatcher does not negotiate propertly
Date Thu, 30 Nov 2006 10:52:22 GMT
    [ ] 
Sjur N. Moshagen commented on COCOON-1369:

Just to confirm this, the site is using both LocaleAction and LocaleMatcher,
and is experiencing similar and related problems. Content negotiated using LocaleAction is
always negotiated properly, whereas content negotiated using LocaleMatcher is not. Here's
the sitemap LocaleMatcher config for the site:

          <map:matcher name="i18n" src="org.apache.cocoon.matching.LocaleMatcher">
            <default-locale language="no" country="NO"/>

If you go to the site mentioned above, the main section of the page (below the tabs) is divided
into three frames. The leftmost frame has content negotiated using LocaleAction, the middle
frame has its content negotiated using LocaleMatcher (initially only, before one starts searching
- the whole site is an interface to a db).

To see the negotiation errors, do the following:
1) open the site
2) depending on the language preferences of your browser, the languages of the left and middle
frame might be the same, or they might be different (this is actually another problem (LocaleAction
and LocaleMatcher giving different negotiated locale), and is not the point of this comment)
3) switch locale using the language list in the upper, right corner of the web page
4) notice how all text is now switched to the same language
5) switch languages several times, and notice how the middle frame after some switches get
"stuck" in a certain language

The way out of the "stucked" situation varies a bit between browsers: with IE/Win the only
option is to delete all cookies and cached web pages, with Safari (Mac) it is enough to reload
the whole page/frameset (just hit reload). Firefox displays a third behaviour: it is always
stuck with the first matched language in the browser's language pref list: given a language
list of es,en,fi,nn,no,nb (from most to least preferred language), Firefox is completely stuck
with 'en' (the first match), irrespective of the requested locale by other means.

In all browsers, all textual content negotiated with LocaleAction behaves correctly. It is
*ONLY* LocaleMatcher that displays the problems discussed above.

Please note that setting @negotiate=false is not an option, as that will return a file-not-found
error when the first browser language is not in the set of available languages. That is an
even less desirable outcome than getting the wrong language.

> LocaleMatcher does not negotiate propertly
> ------------------------------------------
>                 Key: COCOON-1369
>                 URL:
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.2-dev (Current SVN)
>         Environment: Operating System: Linux
> Platform: PC
>            Reporter: Juan Jose Pablos
>         Assigned To: Cocoon Developers Team
>         Attachments:
> Trying to implement LocaleMatcher for forrest.
> given index.xml and and Accept-Language: es,en;q=0.5
> When the @negotiate=false works as expected the is displayed. 
> But when using @negotiate=true index.xml is displayed, which is wrong. It should
> be 
> Added sitemap and files, if you have svn forrest installed it is easier to test:
> mkdir /var/tmp/fs; cd /var/tmp/fs; 
> forrest seed; 
> cd src/documentation; unzip

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message