forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Jose Pablos <che...@che-che.com>
Subject Re: [I18n] Alternatives locales for a given page.
Date Wed, 24 Mar 2004 10:10:13 GMT
Upaya,

The idea is:

on
<map:match pattern="*.html">
         <map:aggregate element="site">
           <map:part src="cocoon:/tab-{0}"/>
           <map:part src="cocoon:/menu-{0}"/>
           <map:part src="cocoon:/body-{0}"/>
           <map:part src="cocoon:/i18n-{0}"/>
         </map:aggregate>

Then

<map:pipeline>
       <map:act type="locale" >
       <map:match pattern="**i18n-*.*">
       <map:generate type="directory" src="{project:content.xdocs}{1}">
         <map:parameter name="dateFormat" value="yyyy-MM-dd hh:mm" />
         <map:parameter name="include" value="^{2}" />
         <map:parameter name="exclude" value="^{2}\.|{2}_{../lang}" />
       </map:generate>
       <map:transform src="{forrest:stylesheets}/directory2i18n.xsl">
         <map:parameter name="ext"    value="{3}" />
       </map:transform>
       <map:transform type="i18n">
         <map:parameter name="locale" value="{../lang}"/>
       </map:transform>
       <map:serialize type="xml"/>
       </map:match>
       </map:act>
     </map:pipeline>

You can see the xsl code here:
http://svn.apache.org/viewcvs.cgi/xml/forrest/trunk/src/core/context/resources/stylesheets/directory2i18n.xsl?root=Apache-SVN



I hope this helps.



Upayavira wrote:
> 
> I've started working on making recursive input modules work, so we could 
> do <map:generate src="{i18n: index.{locales}.xml}"/>, which would find 
> the most appropriate file, given a list of locales.
> 
>> Otherwise, your code seems to be what we want for the language 
>> menu/section - it can easily be extended/moulded in different 
>> directions for various needs and displays. One step forward - thanks 
>> Cheche! 
> 
> 
> How can I see this code without learning Forrest? Can you point me to a 
> viewcvs/svn link for it? I am curious.
> 
> Regards,. Upayavira
> 





Mime
View raw message