lenya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andr...@apache.org
Subject svn commit: r1054242 - in /lenya/branches/BRANCH_2_1_X/src/modules-core/i18n/xslt: flattenCatalogue.xsl modules2include.xsl
Date Sat, 01 Jan 2011 14:58:44 GMT
Author: andreas
Date: Sat Jan  1 14:58:44 2011
New Revision: 1054242

URL: http://svn.apache.org/viewvc?rev=1054242&view=rev
Log:
Improve error handling for missing i18n namespace.

Modified:
    lenya/branches/BRANCH_2_1_X/src/modules-core/i18n/xslt/flattenCatalogue.xsl
    lenya/branches/BRANCH_2_1_X/src/modules-core/i18n/xslt/modules2include.xsl

Modified: lenya/branches/BRANCH_2_1_X/src/modules-core/i18n/xslt/flattenCatalogue.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_2_1_X/src/modules-core/i18n/xslt/flattenCatalogue.xsl?rev=1054242&r1=1054241&r2=1054242&view=diff
==============================================================================
--- lenya/branches/BRANCH_2_1_X/src/modules-core/i18n/xslt/flattenCatalogue.xsl (original)
+++ lenya/branches/BRANCH_2_1_X/src/modules-core/i18n/xslt/flattenCatalogue.xsl Sat Jan  1
14:58:44 2011
@@ -20,11 +20,22 @@
   xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
   
   
-  <xsl:template match="i18n:catalogue/i18n:catalogue">
+  <xsl:template match="*/i18n:catalogue">
     <xsl:apply-templates/>
   </xsl:template>
   
   
+  <xsl:template match="i18n:catalogue-wrapper">
+    <xsl:if test="catalogue">
+      <xsl:message terminate="yes">
+        <xsl:text>The i18n catalogue of the </xsl:text><xsl:value-of select="@name"/>
<xsl:text> </xsl:text>
+        <xsl:text>is missing the i18n namespace (http://apache.org/cocoon/i18n/2.1).</xsl:text>
+      </xsl:message>
+    </xsl:if>
+    <xsl:apply-templates select="i18n:catalogue"/>
+  </xsl:template>
+  
+  
   <xsl:template match="i18n:message">
     <xsl:if test="not(preceding::i18n:message[@key = current()/@key])">
       <xsl:copy>

Modified: lenya/branches/BRANCH_2_1_X/src/modules-core/i18n/xslt/modules2include.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_2_1_X/src/modules-core/i18n/xslt/modules2include.xsl?rev=1054242&r1=1054241&r2=1054242&view=diff
==============================================================================
--- lenya/branches/BRANCH_2_1_X/src/modules-core/i18n/xslt/modules2include.xsl (original)
+++ lenya/branches/BRANCH_2_1_X/src/modules-core/i18n/xslt/modules2include.xsl Sat Jan  1
14:58:44 2011
@@ -29,15 +29,19 @@
   <xsl:param name="pub"/>
   
   <xsl:template match="lenya:publication">
-    <i18n:catalogue>
-      <i:include src="aggregate-fallback://lenya/resources/i18n/{$catalogue}"/>
+    <i18n:catalogue>
+      <i18n:catalogue-wrapper name="'{lenya:name}' publication">
+        <i:include src="aggregate-fallback://lenya/resources/i18n/{$catalogue}"/>
+      </i18n:catalogue-wrapper>
       <xsl:apply-templates select="lenya:modules/lenya:module"/>
     </i18n:catalogue>
   </xsl:template>
   
   <xsl:template match="lenya:module">
-    <xsl:if test="not(preceding-sibling::lenya:module[@name = current()/@name])">
-      <i:include src="cocoon:/modules/{@name}/{$catalogue}"/>
+    <xsl:if test="not(preceding-sibling::lenya:module[@name = current()/@name])">
+      <i18n:catalogue-wrapper name="'{@name}' module">
+        <i:include src="cocoon:/modules/{@name}/{$catalogue}"/>
+      </i18n:catalogue-wrapper>
     </xsl:if>
   </xsl:template>
   



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org


Mime
View raw message