cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierpaolo Fumagalli <p...@apache.org>
Subject Re: Cache
Date Tue, 25 Jan 2000 08:38:54 GMT
Mike Engelhart wrote:
> 
> Donald Ball wrote:
> 
> > Well, we've already had the 'how do i set foreign language preference'
> > fight here already once. It never was resolved to my satisfaction; the
> > consensus seemed to be building towards 'make a special section in the
> > sitemap that let you choose whether you look in the browser's HTTP header
> > for accept-langauges headers or whatever, or look for a special named
> > cookie, or a special named request variable, or something else. That
> > sounded workable to me, if you could come up with a clever syntax for it,
> > but no one ever really tried since we were really hazy on the whole
> > sitemap idea back then. perhaps we need to delegate responsibility? :)
> >
> > Anyway, assuming that you decided to look in the accept-langauges header,
> > you'd just add that data to the key generation routine for the URI's which
> > allowed run-time language negotiation.
> >
> Thanks - I missed that fight :-)
> 
> I'll have to look more into the sitemap and see if anything jumps out at me.
> 
> At least it can be done.

The sitemap proposal includes a "matcher" definition. We can write a
matcher that checks for accept-language and might look like:

<sitemap>
   ...
   <process uri="/localized/*.html" source="/sources/de_DE/*.xml">
     <matcher class="LanguageMatcher">
        <property language="de"/>
     </matcher>
     ...
   </process>
   ...
   <process uri="/localized/*.html" source="/sources/fr_FR/*.xml">
     <matcher class="LanguageMatcher">
        <property language="fr"/>
     </matcher>
     ...
   </process>
   ...
   <process uri="/localized/*.html" source="/sources/en_US/*.xml">
     ...
   </process>
   ...
</sitemap>

In that order the Cocoon will check first if the client accepts german,
it will send the german version, if it accepts french, it will send
french, and in all other cases it'll send english...

	Pier
-- 
--------------------------------------------------------------------
-          P              I              E              R          -
stable structure erected over water to allow the docking of seacraft
<mailto:pier@betaversion.org>    <http://www.betaversion.org/~pier/>
--------------------------------------------------------------------
- ApacheCON Y2K: Come to the official Apache developers conference -
-------------------- <http://www.apachecon.com> --------------------

Mime
View raw message