forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdupoiri...@apache.org
Subject svn commit: r430735 - in /forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo: input.xmap resources/stylesheets/changes-to-document.xsl resources/stylesheets/releaseNotes-to-document.xsl
Date Fri, 11 Aug 2006 09:15:44 GMT
Author: cdupoirieux
Date: Fri Aug 11 02:15:43 2006
New Revision: 430735

URL: http://svn.apache.org/viewvc?rev=430735&view=rev
Log:
FOR-595 - Ok, now the plugin use the skinconf/project-name for the release Notes
FOR-918 - Use the i18n transformer in the pipeline and translate the changes and release notes
page
FOR-919 - the release notes actions are retrieved with a key filtering on the @importance.
Sorry to correct three FOR at once, but they where involving the same files...

Modified:
    forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/input.xmap
    forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-document.xsl
    forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/releaseNotes-to-document.xsl

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/input.xmap
URL: http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/input.xmap?rev=430735&r1=430734&r2=430735&view=diff
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/input.xmap (original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/input.xmap Fri Aug 11
02:15:43 2006
@@ -22,6 +22,14 @@
     </map:generators>
     <map:transformers default="xslt">
       <map:transformer name="cinclude" src="org.apache.cocoon.transformation.CIncludeTransformer"/>
+      <map:transformer name="i18n" 
+        src="org.apache.cocoon.transformation.I18nTransformer">
+        <catalogues default="projectInfo">
+          <catalogue id="other" name="OtherMessages" location="{lm:project.translations}"
/>
+          <catalogue id="projectInfo" name="ProjectInfoMessages" location="{lm:project.translations}"
/>
+        </catalogues>
+        <cache-at-startup>true</cache-at-startup>
+      </map:transformer>
     </map:transformers>
     <map:serializers default="html">
       <map:serializer name="rss091" mime-type="text/xml" src="org.apache.cocoon.serialization.XMLSerializer">
@@ -61,6 +69,9 @@
           <map:parameter name="projectInfo.changes.includeCommitterList" value="{project:projectInfo.changes.includeCommitterList}"/>
           <map:parameter name="projectInfo.changes.includeContributorList" value="{project:projectInfo.changes.includeContributorList}"/>
         </map:transform>
+        <map:transform type="i18n">
+          <map:parameter name="locale" value="{request:locale}" />
+        </map:transform>
         <map:serialize type="xml-document"/>
       </map:match>
     
@@ -73,6 +84,9 @@
           <map:parameter name="projectInfo.changes.sort" value="{project:projectInfo.changes.sort}"/>
           <map:parameter name="projectInfo.changes.includeContributorList" value="{project:projectInfo.changes.includeContributorList}"/>
         </map:transform>
+        <map:transform type="i18n">
+          <map:parameter name="locale" value="{request:locale}" />
+        </map:transform>
         <map:serialize type="xml-document"/>
       </map:match>
 
@@ -83,9 +97,15 @@
       </map:match>
 
       <map:match type="regexp" pattern="^(.*?)([^/]*)releaseNotes_(.*).xml$">
-        <map:generate type="file" src="{lm:project.status}" />
+	<map:aggregate element="agg">
+          <map:part src="cocoon://skinconf.xml"/>
+          <map:part src="{lm:project.status}"/>
+        </map:aggregate>
         <map:transform src="{lm:projectInfo.transform.releaseNotes.document}">
           <map:parameter name="versionNumber" value="{3}"/>
+        </map:transform>
+        <map:transform type="i18n">
+          <map:parameter name="locale" value="{request:locale}" />
         </map:transform>
         <map:serialize type="xml-document"/>
       </map:match>

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-document.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-document.xsl?rev=430735&r1=430734&r2=430735&view=diff
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-document.xsl
(original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-document.xsl
Fri Aug 11 02:15:43 2006
@@ -18,6 +18,7 @@
 
 <xsl:stylesheet
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
     version="1.0">
 
   <xsl:param name="path"/>
@@ -59,7 +60,7 @@
        <xsl:value-of select="@title"/>
      </xsl:when>
      <xsl:otherwise>
-       <xsl:text>History of Changes</xsl:text> <xsl:value-of select="$versionNumber"/>
+       <i18n:text i18n:key="title">History of Changes</i18n:text><xsl:text>
</xsl:text><xsl:value-of select="$versionNumber"/>
      </xsl:otherwise>
     </xsl:choose>
    </title>
@@ -68,20 +69,24 @@
 
     <p><link href="changes.rss"><img src="{$root}images/rss.png" alt="RSS"/></link></p>
     <section id="introduction">
-      <title>Introduction and explanation of symbols</title>
-      <p>Changes are sorted
+      <title><i18n:text i18n:key="introduction">Introduction and explanation
of symbols</i18n:text></title>
+      <p><i18n:text i18n:key="intro_s1_begin">Changes are sorted</i18n:text>
+        <xsl:text> </xsl:text>
         <xsl:if test="$projectInfo.changes.sort!='none'">
-          <xsl:text>by "</xsl:text>
-           <xsl:value-of select="$projectInfo.changes.sort"/>
-          <xsl:text>" and then </xsl:text>
+          <i18n:translate>
+            <i18n:text i18n:key="intro_s1_bythen">by "{0}" and then</i18n:text>
+            <i18n:param><i18n:text><xsl:value-of select="$projectInfo.changes.sort"/></i18n:text></i18n:param>
+          </i18n:translate>
+          <xsl:text> </xsl:text>
         </xsl:if>
-        <xsl:text>chronologically with the most recent at the top.</xsl:text>
-        These symbols denote the various action types:
+        <i18n:text i18n:key="intro_s1_end">chronologically with the most recent at
the top.</i18n:text>
+        <xsl:text> </xsl:text>
+        <i18n:text i18n:key="intro_s2_begin">These symbols denote the various action
types:</i18n:text>
         <xsl:for-each select="//release/action[generate-id()=generate-id(key('types',
@type))]">
           <xsl:sort select="@type"/>
           <icon src="{$root}images/{@type}.jpg" alt="{@type}"/>
           <xsl:text>=</xsl:text>
-          <xsl:value-of select="@type"/>
+          <i18n:text><xsl:value-of select="@type"/></i18n:text>
           <xsl:if test="not(position()=last())">
             <xsl:text>, </xsl:text>
           </xsl:if>
@@ -105,10 +110,9 @@
     </xsl:choose>
     <xsl:if test="$projectInfo.changes.includeCommitterList = 'true' and //developers">
        <section id="all-committers">
-         <title>All Committers</title>
-         <p>This is a list of all people who have ever participated
-         as committers on this project.</p>
-         
+       <title><i18n:text i18n:key="committers">All Committers</i18n:text></title>
+         <p><i18n:text i18n:key="committers_s1">This is a list of all people
who have ever participated
+           as committers on this project.</i18n:text></p>
          <ul>
            <xsl:for-each select="//developers/person">
              <li><xsl:value-of select="@name"/> (<xsl:value-of select="@id"/>)</li>
@@ -122,7 +126,9 @@
 
  <xsl:template match="release">
   <section id="version_{@version}">
-   <title>Version <xsl:value-of select="@version"/> (<xsl:value-of select="@date"/>)</title>
+   <title><i18n:text i18n:key="version">Version</i18n:text>
+   <xsl:text> </xsl:text>
+   <xsl:value-of select="@version"/> (<xsl:value-of select="@date"/>)</title>
    <xsl:apply-templates select="introduction"/>
    <xsl:for-each select="action[generate-id()=generate-id(key('contexts',concat(../@version,
'_', @context)))]">
     <xsl:sort select="@context"/>
@@ -154,9 +160,9 @@
    </xsl:for-each>
    <xsl:if test="$projectInfo.changes.includeContributorList = 'true'">
      <section>
-       <title>Contributors to this release</title>
-       <p>We thank the following people for their contributions to this release.</p>
-       <p>This is a list of all people who participated as committers:<br/>
+       <title><i18n:text i18n:key="release_committers">Contributors to this release</i18n:text></title>
+       <p><i18n:text i18n:key="release_committers_s1">We thank the following
people for their contributions to this release.</i18n:text></p>
+       <p><i18n:text i18n:key="release_committers_s2">This is a list of all people
who participated as committers:</i18n:text><br/>
          <xsl:for-each select="action[generate-id()=generate-id(key('distinct-committer',
concat(../@version, '_', @dev)))]">
            <xsl:sort select="@dev"/>
            <xsl:value-of select="key('committers', @dev)/@name"/>
@@ -172,7 +178,7 @@
          </xsl:for-each>
        </p>
        <xsl:if test="action[@due-to]">
-         <p>This is a list of other contributors:<br/>
+         <p><i18n:text i18n:key="release_committers_s3">This is a list of other
contributors:</i18n:text><br/>
            <xsl:for-each select="action[generate-id()=generate-id(key('distinct-contributor',
concat(../@version, '_', @due-to)))]">
              <xsl:sort select="@due-to"/>
              <xsl:value-of select="@due-to"/>
@@ -196,10 +202,16 @@
   <li>
    <icon src="{$root}images/{@type}.jpg" alt="{@type}"/>
    <xsl:apply-templates/>
-   <xsl:text>Committed by </xsl:text><xsl:value-of select="@dev"/><xsl:text>.</xsl:text>
+   <xsl:text> </xsl:text>
+   <i18n:text i18n:key="committedby">Committed by</i18n:text>
+   <xsl:text> </xsl:text>
+   <xsl:value-of select="@dev"/>
+   <xsl:text>.</xsl:text>
 
    <xsl:if test="@due-to and @due-to!=''">
-    <xsl:text> Thanks to </xsl:text>
+    <xsl:text> </xsl:text>
+    <i18n:text i18n:key="thanksto">Thanks to</i18n:text>
+    <xsl:text> </xsl:text>
     <xsl:choose>
      <xsl:when test="@due-to-email and @due-to-email!=''">
       <link href="mailto:{@due-to-email}">
@@ -214,7 +226,9 @@
    </xsl:if>
 
    <xsl:if test="@fixes-bug">
-     <xsl:text> See Issue </xsl:text>
+     <xsl:text> </xsl:text>
+     <i18n:text i18n:key="seeissue">See Issue</i18n:text>
+     <xsl:text> </xsl:text>
      <xsl:call-template name="print-bugs">
        <xsl:with-param name="buglist" select="translate(normalize-space(@fixes-bug),'
','')"/>
      </xsl:call-template>

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/releaseNotes-to-document.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/releaseNotes-to-document.xsl?rev=430735&r1=430734&r2=430735&view=diff
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/releaseNotes-to-document.xsl
(original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/releaseNotes-to-document.xsl
Fri Aug 11 02:15:43 2006
@@ -18,17 +18,14 @@
 
 <xsl:stylesheet
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
     version="1.0">
 
   <xsl:param name="versionNumber"/>
   <xsl:include href="changes-to-document.xsl"/>
 
-  <!-- Calculate path to site root, eg '../../' -->
-  <xsl:variable name="root">
-    <xsl:call-template name="dotdots">
-      <xsl:with-param name="path" select="$path"/>
-    </xsl:call-template>
-  </xsl:variable>
+  <!-- Key to retrieve important Actions (@important='high') of the selected version sorted
by context... -->
+  <xsl:key name="ActionByVersionByContextByImportance" match="changes/release/action"
use="concat(../@version, '_', @context, '_', @importance)"/>
 
   <!-- versionNumber: detect the value "current" or use the number that was supplied -->
   <xsl:variable name="realVersionNumber">
@@ -45,15 +42,6 @@
     </xsl:choose>
   </xsl:variable>
 
- <!-- FIXME (JJP):  bugzilla is hardwired -->
- <xsl:variable name="bugzilla" select="'http://issues.apache.org/bugzilla/buglist.cgi?bug_id='"/>
-
- <xsl:param name="bugtracking-url" select="$bugzilla"/>
-
- <xsl:template match="/">
-  <xsl:apply-templates select="//changes"/>
- </xsl:template>
-
  <xsl:template match="changes">
   <document>
    <header>
@@ -63,20 +51,25 @@
        <xsl:value-of select="@title"/>
      </xsl:when>
      <xsl:otherwise>
-       <xsl:text>Release Notes for Apache Forrest </xsl:text><xsl:value-of
select="$versionNumber"/>
+       <i18n:translate>
+         <i18n:text i18n:key="titleReleaseNotesFor">Release Notes for {0} {1}</i18n:text>
+         <i18n:param><xsl:value-of select="../../skinconfig/project-name"/></i18n:param>
+         <i18n:param><i18n:text><xsl:value-of select="$versionNumber"/></i18n:text></i18n:param>
+       </i18n:translate>
      </xsl:otherwise>
     </xsl:choose>
    </title>
    </header>
    <body>
      <xsl:if test="contains($realVersionNumber, 'dev')">
-       <warning>Version <xsl:value-of select="$realVersionNumber"/> is a development
release,
+       <warning>
+         <i18n:translate>
+           <i18n:text i18n:key="warningDevRelease">Version {0} is a development release,
        these notes are therefore not complete, they are intended to be an indicator
-       of the major features that are so far included in this version.</warning>
-     </xsl:if>
-
-     <xsl:if test="release[@version=$realVersionNumber]/notes">
-         <xsl:apply-templates select="release[@version=$realVersionNumber]/notes"/>
+       of the major features that are so far included in this version.</i18n:text>
+         <i18n:param><i18n:text><xsl:value-of select="$realVersionNumber"/></i18n:text></i18n:param>
+         </i18n:translate>
+       </warning>
      </xsl:if>
 
      <xsl:apply-templates select="release[@version=$realVersionNumber]"/>
@@ -85,61 +78,41 @@
  </xsl:template>
 
  <xsl:template match="release">
+  <xsl:apply-templates select="notes"/>
   <section id="version_{@version}">
-   <title>Major Changes in Version <xsl:value-of select="@version"/></title>
-   <note>This is not a complete list of changes, a
-   full list of changes in this release
-   <a href="changes_{$versionNumber}.html">is available</a>.</note>
-     <xsl:if test="action[@context='code' and @importance='high']">
-       <section>
-         <title>Important Changes Code Base</title>
-         <ul>
-          <xsl:apply-templates select="action[@context='code' and @importance='high']">
-            <xsl:sort select="@type"/>
-          </xsl:apply-templates>
-         </ul>
-       </section>
-     </xsl:if>
-     <xsl:if test="action[@context='docs' and @importance='high']">
-       <section>
-         <title>Important Changes Documentation</title>
-         <ul>
-          <xsl:apply-templates select="action[@context='docs' and @importance='high']">
-            <xsl:sort select="@type"/>
-          </xsl:apply-templates>
-        </ul>
-       </section>
-     </xsl:if>
-     <xsl:if test="action[@context='admin' and @importance='high']">
-       <section>
-         <title>Important Changes Project Administration</title>
-         <ul>
-           <xsl:apply-templates select="action[@context='admin' and @importance='high']">
-            <xsl:sort select="@type"/>
-          </xsl:apply-templates>
-         </ul>
-       </section>
-     </xsl:if>
-     <xsl:if test="action[@context='design' and @importance='high']">
-       <section>
-         <title>Important Changes Design</title>
-         <ul>
-          <xsl:apply-templates select="action[@context='design' and @importance='high']">
-            <xsl:sort select="@type"/>
-          </xsl:apply-templates>
-         </ul>
-       </section>
-     </xsl:if>
-     <xsl:if test="action[@context='build' and @importance='high']">
-       <section>
-         <title>Important Changes Build</title>
-         <ul>
-           <xsl:apply-templates select="action[@context='build' and @importance='high']">
-            <xsl:sort select="@type"/>
+   <title><i18n:text i18n:key="majorChanges">Major Changes in Version</i18n:text><xsl:text>
</xsl:text><xsl:value-of select="@version"/></title>
+   <note><i18n:text i18n:key="noteMajorChanges">This is not a complete list of
changes, a
+           full list of changes in this release</i18n:text>
+   <xsl:text> </xsl:text>
+   <a href="changes_{$versionNumber}.html"><i18n:text i18n:key="isavailable">is
available</i18n:text></a>.</note>
+   <xsl:for-each select="action[generate-id()=generate-id(key('ActionByVersionByContextByImportance',concat(../@version,
'_', @context, '_high')))]">
+    <xsl:sort select="@context"/>
+    <section>
+    <xsl:variable name="context" select="@context"/>
+    <title>
+    <xsl:choose>
+      <xsl:when test="//contexts/context[@id=$context]">
+       <xsl:value-of select="//contexts/context[@id=$context]/@title"/>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:value-of select="@context"/>
+      </xsl:otherwise>
+    </xsl:choose>
+    </title>
+     <ul>
+      <xsl:choose>
+        <xsl:when test="contains($projectInfo.changes.sort, 'type')">
+          <xsl:apply-templates select="key('ActionByVersionByContextByImportance',concat(../@version,
'_', @context, '_high') )">
+              <xsl:sort select="@type"/>
           </xsl:apply-templates>
-         </ul>
-       </section>
-     </xsl:if>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="key('ActionByVersionByContextByImportance',concat(../@version,
'_', @context, '_high') )"/>
+        </xsl:otherwise>
+      </xsl:choose>
+     </ul>
+    </section>
+   </xsl:for-each>
   </section>
  </xsl:template>
 



Mime
View raw message