You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2008/02/08 17:15:10 UTC

svn commit: r619925 - in /lenya/trunk/src/modules-core/i18n: sitemap.xmap xslt/emptyCatalogue.xml xslt/modules2include.xsl

Author: andreas
Date: Fri Feb  8 08:15:07 2008
New Revision: 619925

URL: http://svn.apache.org/viewvc?rev=619925&view=rev
Log:
Don't include module i18n catalogues directly but via pipeline. This way, the result can be cached even if catalogues are missing.

Added:
    lenya/trunk/src/modules-core/i18n/xslt/emptyCatalogue.xml
      - copied, changed from r619696, lenya/trunk/src/webapp/lenya/resources/i18n/emptyCatalogue.xml
Modified:
    lenya/trunk/src/modules-core/i18n/sitemap.xmap
    lenya/trunk/src/modules-core/i18n/xslt/modules2include.xsl

Modified: lenya/trunk/src/modules-core/i18n/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/i18n/sitemap.xmap?rev=619925&r1=619924&r2=619925&view=diff
==============================================================================
--- lenya/trunk/src/modules-core/i18n/sitemap.xmap (original)
+++ lenya/trunk/src/modules-core/i18n/sitemap.xmap Fri Feb  8 08:15:07 2008
@@ -58,6 +58,22 @@
         <map:serialize type="xml"/>
       </map:match>
       
+      <!-- Generate module i18n catalogues. We use the selector instead of direct inclusion
+        because otherwise the result wouldn't be cached when catalogues are missing. -->
+      <!-- modules/{1:module}/{2:catalogue} -->
+      <map:match pattern="modules/*/*">
+        <map:select type="resource-exists">
+          <map:when test="aggregate-fallback://lenya/modules/{1}/resources/i18n/{2}">
+            <map:generate src="aggregate-fallback://lenya/modules/{1}/resources/i18n/{2}"/>
+            <map:serialize type="xml"/>
+          </map:when>
+          <map:otherwise>
+            <map:generate src="xslt/emptyCatalogue.xml"/>
+            <map:serialize type="xml"/>
+          </map:otherwise>
+        </map:select>
+      </map:match>
+      
     </map:pipeline>  
   </map:pipelines>
   

Copied: lenya/trunk/src/modules-core/i18n/xslt/emptyCatalogue.xml (from r619696, lenya/trunk/src/webapp/lenya/resources/i18n/emptyCatalogue.xml)
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/i18n/xslt/emptyCatalogue.xml?p2=lenya/trunk/src/modules-core/i18n/xslt/emptyCatalogue.xml&p1=lenya/trunk/src/webapp/lenya/resources/i18n/emptyCatalogue.xml&r1=619696&r2=619925&rev=619925&view=diff
==============================================================================
--- lenya/trunk/src/webapp/lenya/resources/i18n/emptyCatalogue.xml (original)
+++ lenya/trunk/src/modules-core/i18n/xslt/emptyCatalogue.xml Fri Feb  8 08:15:07 2008
@@ -16,8 +16,6 @@
   limitations under the License.
 -->
 
-<!-- $Id: cmsui_de.xml 446542 2006-09-15 08:14:39Z andreas $ -->
-
-<catalogue/>
+<catalogue xmlns:i18n="http://apache.org/cocoon/i18n/2.1"/>
 
 

Modified: lenya/trunk/src/modules-core/i18n/xslt/modules2include.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/i18n/xslt/modules2include.xsl?rev=619925&r1=619924&r2=619925&view=diff
==============================================================================
--- lenya/trunk/src/modules-core/i18n/xslt/modules2include.xsl (original)
+++ lenya/trunk/src/modules-core/i18n/xslt/modules2include.xsl Fri Feb  8 08:15:07 2008
@@ -39,9 +39,7 @@
   
   <xsl:template match="lenya:module">
     <xsl:if test="not(preceding-sibling::lenya:module[@name = current()/@name])">
-      <i:include src="aggregate-fallback://lenya/modules/{@name}/resources/i18n/{$catalogue}" strip-root="true">
-        <i:fallback/>
-      </i:include>
+      <i:include src="cocoon:/modules/{@name}/{$catalogue}" strip-root="true"/>
     </xsl:if>
   </xsl:template>
 



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