forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From che...@apache.org
Subject cvs commit: xml-forrest/src/resources/stylesheets i18n.xsl
Date Tue, 16 Sep 2003 16:35:09 GMT
cheche      2003/09/16 09:35:09

  Modified:    .        status.xml
               src/resources/conf cocoon.xconf menu.xmap sitemap.xmap
               src/resources/forrest-shbat forrest.build.xml
  Added:       src/resources/fresh-site/src/documentation/translations
                        menu_es.xml menu_it.xml
               src/resources/stylesheets i18n.xsl
  Log:
  First I18n integration for menus.
  PR: FOR-9
  
  Revision  Changes    Path
  1.217     +4 -1      xml-forrest/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/xml-forrest/status.xml,v
  retrieving revision 1.216
  retrieving revision 1.217
  diff -u -r1.216 -r1.217
  --- status.xml	16 Sep 2003 14:54:59 -0000	1.216
  +++ status.xml	16 Sep 2003 16:35:08 -0000	1.217
  @@ -25,6 +25,9 @@
   
     <changes>
       <release version="0.6-dev" date="unreleased">
  +      <action dev="JJP" type="add" context="core" fixes-bug="FOR-9" >
  +       First I18n integration for menus in forrest.
  +      </action>
         <action dev="JJP" type="update" context="core">
           Add "version_" to section@id to validate as document-v12.
   	Sort action types order to "add","remove","update","fix".
  
  
  
  1.23      +1 -0      xml-forrest/src/resources/conf/cocoon.xconf
  
  Index: cocoon.xconf
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/conf/cocoon.xconf,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- cocoon.xconf	10 Sep 2003 09:37:09 -0000	1.22
  +++ cocoon.xconf	16 Sep 2003 16:35:08 -0000	1.23
  @@ -163,6 +163,7 @@
           <skin>@skin@</skin>
           <menu-scheme>@menu-scheme@</menu-scheme>
           <bugtracking-url>@bugtracking-url@</bugtracking-url>
  +        <i18n>@i18n@</i18n>
         </values>
       </component-instance>
   
  
  
  
  1.10      +21 -3     xml-forrest/src/resources/conf/menu.xmap
  
  Index: menu.xmap
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/conf/menu.xmap,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- menu.xmap	7 Aug 2003 14:09:00 -0000	1.9
  +++ menu.xmap	16 Sep 2003 16:35:08 -0000	1.10
  @@ -83,7 +83,6 @@
               <!-- If a hand-created book.xml exists, use it -->
               <map:parameter name="url" value="content/xdocs/{1}book.xml" />
               <map:generate src="content/xdocs/{1}book.xml" />
  -            <map:serialize type="xml"/>
             </map:when>
   
             <map:otherwise>
  @@ -91,10 +90,29 @@
               <map:generate src="cocoon:/{1}menulinks-{2}" />
               <!-- The above generates the subset of the linkmap relevant to our directory.
-->
               <map:transform src="resources/stylesheets/site2book.xsl" />
  -            <map:serialize type="xml"/>
             </map:otherwise>
   
           </map:select>
  +	
  +        <map:select type="config">
  +           <map:when test="{defaults:i18n}">
  +
  +             <map:act type="locale">
  +              <map:transform src="resources/stylesheets/i18n.xsl"/>
  +	      <map:transform type="i18n">
  +	        <!-- We can use a default locale attribute or Request Parameter
  +	        <map:parameter name="locale" value="{defaults:locale}"/>
  +	        <map:parameter name="locale" value="{request-param:locale}"/>
  +	        -->
  +	        <map:parameter name="locale" value="{lang}{country}{variant}"/>
  +	      </map:transform>
  +
  +	    </map:act>
  +
  +          </map:when>
  +        </map:select>
  +	
  +	<map:serialize type="xml"/>
   
         </map:match>
   
  
  
  
  1.119     +15 -1     xml-forrest/src/resources/conf/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/conf/sitemap.xmap,v
  retrieving revision 1.118
  retrieving revision 1.119
  diff -u -r1.118 -r1.119
  --- sitemap.xmap	10 Sep 2003 20:21:45 -0000	1.118
  +++ sitemap.xmap	16 Sep 2003 16:35:08 -0000	1.119
  @@ -61,6 +61,16 @@
         </map:transformer>
   
         <map:transformer name="xinclude" src="org.apache.cocoon.transformation.XIncludeTransformer"
logger="sitemap.transformer.xinclude" pool-grow="2" pool-max="16" pool-min="2" />
  +
  +    <map:transformer name="i18n" src="org.apache.cocoon.transformation.I18nTransformer">
  +      <catalogues default="menu">
  +        <catalogue id="menu" name="menu" location="translations"/>
  +      </catalogues>
  +      <!-- Commented out to verify your translations
  +      <untranslated-text>untranslated</untranslated-text> -->
  +      <cache-at-startup>true</cache-at-startup>
  +    </map:transformer>
  +
       </map:transformers>
   
       <map:readers default="resource">
  @@ -100,6 +110,10 @@
       <map:selectors>
         <map:selector logger="sitemap.selector.exists" name="exists" src="org.apache.cocoon.selection.ResourceExistsSelector"
/>
       </map:selectors>
  +    <map:actions>
  +      <map:action name="locale" src="org.apache.cocoon.acting.LocaleAction" />
  +    </map:actions>
  +
   
       <map:pipes default="caching">
         <map:pipe name="caching" src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline"/>
  
  
  
  1.99      +12 -2     xml-forrest/src/resources/forrest-shbat/forrest.build.xml
  
  Index: forrest.build.xml
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/forrest-shbat/forrest.build.xml,v
  retrieving revision 1.98
  retrieving revision 1.99
  diff -u -r1.98 -r1.99
  --- forrest.build.xml	14 Sep 2003 13:40:57 -0000	1.98
  +++ forrest.build.xml	16 Sep 2003 16:35:09 -0000	1.99
  @@ -74,6 +74,7 @@
       <property name="project.configfile"   value="${project.ctxt-dir}/WEB-INF/cli.xconf"
/>
       <property name="project.logkitfile"   value="${project.ctxt-dir}/WEB-INF/logkit.xconf"
/>
       <property name="project.logger"       value="" />
  +    <property name="project.i18n"         value="false" />
   
       <!-- use of these property should be removed when the siteplan becomes active -->
       <property name="project.skin"        value="forrest-site" />
  @@ -106,6 +107,7 @@
       <property name="project.conf-dir"    location="${project.content-dir}/conf" />
       <property name="project.lib-dir"     location="${project.content-dir}/lib" />
       <property name="project.classes-dir" location="${project.content-dir}/classes" />
  +    <property name="project.translations-dir" location="${project.content-dir}/translations"
/>
   
       <!-- checks for presence of required classes and/or resources -->
       <property name="tools.jar"           location="${java.home}/../lib/tools.jar"/>
  @@ -130,6 +132,7 @@
       <available property="skins.present" file="${project.skins-dir}" type="dir"/>
       <available property="skinconf.present" file="${project.skinconf}"/>
       <available property="status.present" file="${project.status}"/>
  +    <available property="translations.present" file="${project.translations-dir}" type="dir"
/>
     </target>
   
     <target name="validation-props" depends="examine-proj">
  @@ -329,6 +332,7 @@
       <filter token="bugtracking-url"   value="${project.bugtracking-url}" />
       <filter token="local-catalog"     value="${project.catalog}" />
       <filter token="catalog-verbosity" value="${forrest.catalog.verbosity}" />
  +    <filter token="i18n"              value="${project.i18n}" />
   
       <!--
       These filters defined for backwards-compatibility with old skins.
  @@ -403,7 +407,7 @@
     <target name="project-context" depends="examine-proj, ensure-content,
       validate, init, bare-context, copy-sitemap, copy-conf,
       copy-xdocs, copy-stylesheets, copy-images, copy-grammars, copy-resources, copy-content,
copy-lib, 
  -    copy-classes, copy-skins, copy-skinconf, copy-status"/>
  +    copy-classes, copy-skins, copy-skinconf, copy-status, copy-translations"/>
   
     <target name="copy-conf" if="conf.present">
       <copy toDir="${project.ctxt-dir}/WEB-INF" filtering="true"
  @@ -519,6 +523,12 @@
   
     <target name="copy-status" if="status.present">
       <copy file="${project.status}" todir="${project.ctxt-dir}" />
  +  </target>
  +
  +  <target name="copy-translations" if="translations.present" >
  +    <copy todir="${project.ctxt-dir}/translations">
  +    <fileset dir="${project.translations-dir}"/>
  +    </copy>
     </target>
   
   
  
  
  
  1.1                  xml-forrest/src/resources/fresh-site/src/documentation/translations/menu_es.xml
  
  Index: menu_es.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <catalogue
  xml:lang="es"
  ><message
  key="About"
  >Sobre</message
  ><message
  key="Index"
  >Indice</message
  ><message
  key="Changes"
  >Cambios</message
  ><message
  key="Todo"
  >Cosas que hacer</message
  ><message
  key="Samples"
  >Ejemplos</message
  ><message
  key="Apache document page"
  >Página documento Apache</message
  ><message
  key="Static content"
  >Contenido Estatico</message
  ><message
  key="Wiki page"
  >Página Wiki</message
  ><message
  key="ihtml page"
  >Página ihtml</message
  ><message
  key="ehtml page"
  >Página ehtml</message
  ><message
  key="FAQ"
  >Preguntas Frecuentes</message
  ><message
  key="Simplifed Docbook page"
  >Página Simplifed Docbook</message
  ><message
  key="XSP page"
  >Página XSP</message
  ></catalogue
  >
  
  
  1.1                  xml-forrest/src/resources/fresh-site/src/documentation/translations/menu_it.xml
  
  Index: menu_it.xml
  ===================================================================
  <?xml version="1.0"?>
    <catalogue xml:lang="it">
       <message key="About">Circa</message>
       <message key="Index">Indice</message>
       <message key="Changes">Cambiamenti</message>         
       <message key="Todo">Cose da fare</message>         
       <message key="Samples">Esempi</message>         
       <message key="Apache document page">Pagina Apache document</message>
       <message key="Static content">Contenuto Statico</message>
       <message key="Wiki page">Pagina Wiki</message>         
       <message key="ihtml page">Pagina ihtml</message>         
       <message key="ehtml page">Pagina ehtml</message>         
       <message key="FAQ">Domande frequenti</message>         
       <message key="Simplifed Docbook page">Pagina Simplifed Docbook</message>
        
       <message key="XSP page">Pagina XSP</message>
    </catalogue>
  
  
  
  1.1                  xml-forrest/src/resources/stylesheets/i18n.xsl
  
  Index: i18n.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <!--+
      | Add i18n tags so it can be processer.
      |
      | CVS $Id: i18n.xsl,v 1.1 2003/09/16 16:35:09 cheche Exp $
      +-->
  
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  		xmlns:i18n="http://apache.org/cocoon/i18n/2.1" >
  
    <xsl:import href="copyover.xsl"/>
  
    <xsl:template match="@label">
     <xsl:attribute name="i18n:attr">label</xsl:attribute>
     <xsl:attribute name="label">
       <xsl:value-of select="." />
     </xsl:attribute>
       <xsl:apply-templates />
    </xsl:template>
    
    <!-- FIXME: Need support for more than one attribute
    <xsl:template match="@description">
     <xsl:attribute name="i18n:attr">description</xsl:attribute>
     <xsl:attribute name="description">
       <xsl:value-of select="." />
     </xsl:attribute>
       <xsl:apply-templates />
    </xsl:template>
    -->
  
  </xsl:stylesheet>
  
  
  

Mime
View raw message