]> granicus.if.org Git - apache/commitdiff
add untranslated directives to the output
authorAndré Malo <nd@apache.org>
Fri, 10 Dec 2010 23:17:11 +0000 (23:17 +0000)
committerAndré Malo <nd@apache.org>
Fri, 10 Dec 2010 23:17:11 +0000 (23:17 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1044532 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/style/xsl/directiveindex.xsl
docs/manual/style/xsl/quickreference.xsl
docs/manual/style/xsl/synopsis.xsl

index 1e13e7d6dbf8392f00bcceb90c0164db22ec870d..062ad3880151168e96d37ddb618f43b7a2cd104b 100644 (file)
         <xsl:call-template name="top"/>
 
         <xsl:variable name="directives"
-            select="document(document($allmodules)/modulefilelist/modulefile)
-                        /modulesynopsis[status!='Obsolete']
-                        /directivesynopsis[not(@location)]" />
+            select="document(
+                        document(document(document(
+                            $allmodules)/modulefilelist/modulefile
+                        )/*/@metafile)
+                        /metafile/@reference
+                    )
+                    /modulesynopsis[status!='Obsolete']
+                    /directivesynopsis[not(@location)]" />
 
         <!-- collect the start letters -->
         <xsl:variable name="start-letters">
index 9af5bac3d3e42b7866f6db3c7c47b9f6ef1f9757..d59769e7eb135ebd6d300f6070bd83f7dd0f43d0 100644 (file)
 
         <div id="directive-ref">
             <xsl:variable name="directives"
-                select="document(document($allmodules)/modulefilelist/modulefile)
+                select="document(document(document(
+                            document($allmodules)/modulefilelist/modulefile
+                        )/*/@metafile)/metafile/@reference)
                         /modulesynopsis/directivesynopsis[not(@location)]" />
+            <xsl:variable name="modules"
+                select="document(
+                            document($allmodules)/modulefilelist/modulefile
+                        )/modulesynopsis" />
 
             <xsl:variable name="start-letters">
                 <xsl:call-template name="directive-startletters">
                 <xsl:with-param name="letters-todo" select="$start-letters" />
                 <xsl:with-param name="offset" select="number(0)" />
                 <xsl:with-param name="directives" select="$directives" />
+                <xsl:with-param name="modules" select="$modules" />
             </xsl:call-template>
             </table>
         </div>&lf; <!-- /#directive-ref -->
 <xsl:param name="letters-todo" />
 <xsl:param name="offset" />
 <xsl:param name="directives" />
+<xsl:param name="modules" />
 
 <xsl:variable name="letter" select="substring($letters-todo, 1, 1)" />
 
                                           $lowercase,$uppercase)]">
 <xsl:sort select="name" />
 
+    <xsl:choose>
+    <xsl:when test="$modules[name=current()/../name]
+                    /directivesynopsis[name=current()/name]">
+        <xsl:call-template name="reference-of-letter-loop">
+            <xsl:with-param name="letter" select="$letter" />
+            <xsl:with-param name="directive"
+                select="$modules[name=current()/../name]
+                        /directivesynopsis[name=current()/name]" />
+            <xsl:with-param name="offset" select="$offset" />
+            <xsl:with-param name="position" select="position()" />
+        </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+        <xsl:call-template name="reference-of-letter-loop">
+            <xsl:with-param name="letter" select="$letter" />
+            <xsl:with-param name="directive" select="." />
+            <xsl:with-param name="offset" select="$offset" />
+            <xsl:with-param name="position" select="position()" />
+        </xsl:call-template>
+    </xsl:otherwise>
+    </xsl:choose>
+
+</xsl:for-each> <!-- /directives -->
+
+<!-- call next letter, if there is -->
+<xsl:if test="string-length($letters-todo) &gt; 1">
+    <xsl:call-template name="reference-of-letter">
+        <xsl:with-param name="letters-todo"
+            select="substring($letters-todo, 2)" />
+        <xsl:with-param name="offset"
+            select="(count($directives[$letter=translate(substring(
+                        normalize-space(name), 1, 1),
+                        $lowercase, $uppercase)])
+                    + $offset) mod 2" />
+        <xsl:with-param name="directives" select="$directives" />
+        <xsl:with-param name="modules" select="$modules" />
+    </xsl:call-template>
+</xsl:if>
+</xsl:template>
+<!-- /reference-of-letter -->
+
+
+<xsl:template name="reference-of-letter-loop">
+<xsl:param name="directive" />
+<xsl:param name="letter" />
+<xsl:param name="offset" />
+<xsl:param name="position" />
+
     <tr>
-        <xsl:if test="position() mod 2 = $offset">
+        <xsl:if test="$position mod 2 = $offset">
             <xsl:attribute name="class">odd</xsl:attribute>
         </xsl:if>
 
         <td>
-            <a href="{../name}.html#{translate(name, $uppercase, $lowercase)}">
-                <xsl:if test="position()=1">
+            <a href="{$directive/../name}.html#{
+                        translate($directive/name, $uppercase, $lowercase)}">
+                <xsl:if test="$position = 1">
                     <xsl:attribute name="id">
                         <xsl:value-of select="$letter" />
                     </xsl:attribute>
                     </xsl:attribute>
                 </xsl:if>
 
-                <xsl:apply-templates select="syntax" />
+                <xsl:apply-templates select="$directive/syntax" />
             </a>
         </td>
         <td>
             <!-- (add the + character instead)                        -->
             <xsl:variable name="default">
                 <xsl:choose>
-                <xsl:when test="count(default[count(br) &gt; 0]) &gt; 0">
+                <xsl:when test="count($directive/default[count(br) &gt; 0])
+                                &gt; 0">
                     <xsl:value-of
-                        select="default/child::node()
+                        select="$directive/default/child::node()
                                 [count(preceding-sibling::*) = 0]" />
                 </xsl:when>
                 <xsl:otherwise>
-                    <xsl:value-of select="default"/>
+                    <xsl:value-of select="$directive/default"/>
                 </xsl:otherwise>
                 </xsl:choose>
             </xsl:variable>
                                   ' '), name),1,20)" />
             <xsl:if test="string-length(substring-after(concat($default, ' '),
                               name)) &gt; 20
-                          or count(default[count(br) &gt; 0]) &gt; 0">
+                          or count($directive/default[count(br) &gt; 0])
+                             &gt; 0">
                 <xsl:text> +</xsl:text>
             </xsl:if>
         </td>
         <td>
-            <xsl:if test="contextlist/context
+            <xsl:if test="$directive/contextlist/context
                           [normalize-space(.)='server config']">
                 <xsl:value-of select="$message[@id='serverconfig']/@letter"/>
             </xsl:if>
-            <xsl:if test="contextlist/context
+            <xsl:if test="$directive/contextlist/context
                           [normalize-space(.)='virtual host']">
                 <xsl:value-of select="$message[@id='virtualhost']/@letter"/>
             </xsl:if>
-            <xsl:if test="contextlist/context
+            <xsl:if test="$directive/contextlist/context
                           [normalize-space(.)='directory']">
                 <xsl:value-of select="$message[@id='directory']/@letter"/>
             </xsl:if>
-            <xsl:if test="contextlist/context
+            <xsl:if test="$directive/contextlist/context
                           [normalize-space(.)='.htaccess']">
                 <xsl:value-of select="$message[@id='htaccess']/@letter"/>
             </xsl:if>
         </td>
         <td>
             <xsl:choose>
-            <xsl:when test="../status='External'">
+            <xsl:when test="$directive/../status='External'">
                 <xsl:choose>
-                <xsl:when test="../status/@href">
-                    <a href="{../status/@href}">
+                <xsl:when test="$directive/../status/@href">
+                    <a href="{$directive/../status/@href}">
                         <xsl:value-of
                             select="$message[@id='external']/@letter"/>
                     </a>
             </xsl:when>
             <xsl:otherwise>
                 <xsl:variable name="status" select="translate(
-                    ../status, $uppercase, $lowercase)"/>
+                    $directive/../status, $uppercase, $lowercase)"/>
                 <xsl:value-of select="$message[@id=$status]/@letter"/>
             </xsl:otherwise>
             </xsl:choose>
         </td>
     </tr>
     <tr>
-        <xsl:if test="position() mod 2 = $offset">
+        <xsl:if test="$position mod 2 = $offset">
             <xsl:attribute name="class">odd</xsl:attribute>
         </xsl:if>
 
         <td colspan="4" class="descr">
             <xsl:choose>
-            <xsl:when test="string-length(normalize-space(description)) &gt; 0">
-                <xsl:apply-templates select="description"/>
+            <xsl:when test="string-length(normalize-space(
+                                $directive/description)) &gt; 0">
+                <xsl:apply-templates select="$directive/description" />
             </xsl:when>
             <xsl:otherwise>
                 <xsl:text>-</xsl:text>
             </xsl:choose>
         </td>
     </tr>&lf;
-</xsl:for-each> <!-- /directives -->
-
-<!-- call next letter, if there is -->
-<xsl:if test="string-length($letters-todo) &gt; 1">
-    <xsl:call-template name="reference-of-letter">
-        <xsl:with-param name="letters-todo"
-            select="substring($letters-todo, 2)" />
-        <xsl:with-param name="offset"
-            select="(count($directives[$letter=translate(substring(
-                    normalize-space(name), 1, 1), $lowercase, $uppercase)])
-                    + $offset) mod 2" />
-        <xsl:with-param name="directives" select="$directives" />
-    </xsl:call-template>
-</xsl:if>
 </xsl:template>
-<!-- /reference-of-letter -->
 
 </xsl:stylesheet>
index ffa18e0e029c3b9021aea6abdbe458ab45de6dbf..f7b74f0ba1a8cd811023d6fac3027b57dfcfaa77 100644 (file)
                         </h3>&lf;
 
                         <xsl:choose>
-                        <xsl:when test="directivesynopsis">
+                        <xsl:when test="document($metafile/@reference)
+                                        /modulesynopsis/directivesynopsis">
                             <ul id="toc">&lf;
-                            <xsl:for-each select="directivesynopsis">
+                            <xsl:for-each
+                            select="document($metafile/@reference)
+                                    /modulesynopsis/directivesynopsis">
                             <xsl:sort select="name" />
                                 <xsl:variable name="lowername"
                                     select="translate(name, $uppercase,
             <!-- Sections of documentation about the module as a whole -->
             <xsl:apply-templates select="section" />&lf;
 
+            <xsl:variable name="this" select="directivesynopsis" />
+
             <!-- Directive documentation -->
-            <xsl:apply-templates select="directivesynopsis">
-                <xsl:sort select="name" />
-            </xsl:apply-templates>
+            <xsl:for-each select="document($metafile/@reference)
+                                  /modulesynopsis/directivesynopsis">
+            <xsl:sort select="name" />
+                <xsl:choose>
+                <xsl:when test="$this[name=current()/name]">
+                    <xsl:apply-templates select="$this[name=current()/name]" />
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:apply-templates select=".">
+                        <xsl:with-param name="translated" select="'no'" />
+                    </xsl:apply-templates>
+                </xsl:otherwise>
+                </xsl:choose>
+            </xsl:for-each>
         </div>&lf; <!-- /#page-content -->
 
         <xsl:call-template name="bottom" />&lf;
 <!-- Directivesynopsis                                                    -->
 <!-- ==================================================================== -->
 <xsl:template match="directivesynopsis">
+<xsl:param name="translated" select="'yes'" />
+
 <xsl:if test="not(@location)">
     <xsl:call-template name="toplink" />&lf;
 
         </xsl:if>&lf;
         </table>
 
-        <xsl:apply-templates select="usage" />&lf;
+        <xsl:choose>
+        <xsl:when test="$translated = 'yes'">
+            <xsl:apply-templates select="usage" />&lf;
+        </xsl:when>
+        <xsl:otherwise>
+            <p>The documentation of this directive was not translated yet.
+            Please refer to the English version.</p>
+        </xsl:otherwise>
+        </xsl:choose>
 
         <xsl:if test="seealso">
             <h3>