forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From che...@apache.org
Subject svn commit: rev 9742 - in xml/forrest/trunk: . src/core/context src/core/context/resources/stylesheets src/core/fresh-site/src/documentation/translations
Date Thu, 25 Mar 2004 12:18:53 GMT
Author: cheche
Date: Thu Mar 25 04:18:51 2004
New Revision: 9742

Added:
   xml/forrest/trunk/src/core/fresh-site/src/documentation/translations/langcode.xml
Modified:
   xml/forrest/trunk/src/core/context/i18n.xmap
   xml/forrest/trunk/src/core/context/resources/stylesheets/directory2i18n.xsl
   xml/forrest/trunk/status.xml
Log:
Add localise language name for the alternative languages.


Modified: xml/forrest/trunk/src/core/context/i18n.xmap
==============================================================================
--- xml/forrest/trunk/src/core/context/i18n.xmap	(original)
+++ xml/forrest/trunk/src/core/context/i18n.xmap	Thu Mar 25 04:18:51 2004
@@ -28,6 +28,7 @@
       <map:transformer name="i18n" src="org.apache.cocoon.transformation.I18nTransformer">
         <catalogues default="languages">
           <catalogue id="languages" name="languages" location="{project:translations}"/>
+          <catalogue id="langcode" name="langcode" location="{project:translations}"/>
         </catalogues>
       </map:transformer>
     </map:transformers>
@@ -51,7 +52,7 @@
       <map:transform type="i18n">
         <map:parameter name="locale" value="{../lang}"/>
       </map:transform>
-      <map:serialize type="xml"/>
+      <map:serialize />
       </map:match>
       </map:act>
     </map:pipeline>

Modified: xml/forrest/trunk/src/core/context/resources/stylesheets/directory2i18n.xsl
==============================================================================
--- xml/forrest/trunk/src/core/context/resources/stylesheets/directory2i18n.xsl	(original)
+++ xml/forrest/trunk/src/core/context/resources/stylesheets/directory2i18n.xsl	Thu Mar 25
04:18:51 2004
@@ -14,6 +14,9 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
+<!--
+  Create a div element with all the alternate language versions.
+-->
 
 <xsl:stylesheet exclude-result-prefixes="dir" version="1.0"
     xmlns:dir="http://apache.org/cocoon/directory/2.0" 
@@ -27,17 +30,30 @@
             <xsl:apply-templates/>
         </div>
     </xsl:template>
+
     <xsl:template match="dir:file">
+    <!-- Assume that the file pattern is resource_locale.extension -->
      <xsl:element name="a">
        <xsl:attribute name="href">
-         <xsl:value-of select="concat(substring-before(@name,'.'),'.',$ext)"/>
+         <xsl:value-of select="concat(substring-before(@name,'_'),'.',$ext)"/>
        </xsl:attribute >
        <xsl:attribute name="hreflang">
          <xsl:value-of select="substring-after(substring-before(@name, '.'),'_')"/>
        </xsl:attribute >
-     <xsl:element name="i18n:text">
+       <xsl:attribute name="lang">
+       <!-- It just specify that the content on "a" element is in this language -->
          <xsl:value-of select="substring-after(substring-before(@name, '.'),'_')"/>
-     </xsl:element>
+       </xsl:attribute >
+       <xsl:attribute name="rel">
+         <xsl:value-of select="'alternate'"/>
+       </xsl:attribute>
+     <xsl:attribute name="i18n:attr">title</xsl:attribute>
+     <xsl:attribute name="title" >
+           <xsl:value-of select="substring-after(substring-before(@name, '.'),'_')"/>
+     </xsl:attribute>
+     <i18n:text i18n:catalogue="langcode">
+           <xsl:value-of select="substring-after(substring-before(@name, '.'),'_')"/>
+     </i18n:text>
      </xsl:element>
     </xsl:template>
 </xsl:stylesheet>

Added: xml/forrest/trunk/src/core/fresh-site/src/documentation/translations/langcode.xml
==============================================================================
--- (empty file)
+++ xml/forrest/trunk/src/core/fresh-site/src/documentation/translations/langcode.xml	Thu
Mar 25 04:18:51 2004
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2002-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!--
+  This catalog is used so displays how the language name 
+  is named by their speakers.
+-->
+<catalogue >
+  <message key="en">English</message>
+  <message key="es">Espanol</message>
+  <message key="it">Italiano</message>
+</catalogue>

Modified: xml/forrest/trunk/status.xml
==============================================================================
--- xml/forrest/trunk/status.xml	(original)
+++ xml/forrest/trunk/status.xml	Thu Mar 25 04:18:51 2004
@@ -44,6 +44,9 @@
 
   <changes>
     <release version="0.6-dev" date="unreleased">
+      <action dev="JJP" type="add" context="core" >
+        The language alternative div displays language in your own language.
+      </action>
       <action dev="DB" type="add" context="core" >
         Docbook support for refentry element and it's children.  Generally used for man pages.
       </action>

Mime
View raw message