[yelp-tools] yelp-build: Fix directionality issues for Mallard



commit a136765214efd9d7854b6849229ac3d0003fd8d2
Author: Shaun McCance <shaunm gnome org>
Date:   Mon Aug 19 12:49:39 2013 -0400

    yelp-build: Fix directionality issues for Mallard
    
    yelp-build actually uses the cache as the primary input document
    for Mallard docs. A lot of the globals in l10n don't work, because
    they don't get their info from each page element.

 tools/yelp-build.in |   34 +++++++++++++++++++++-------------
 1 files changed, 21 insertions(+), 13 deletions(-)
---
diff --git a/tools/yelp-build.in b/tools/yelp-build.in
index 9be5ac7..ce24f87 100755
--- a/tools/yelp-build.in
+++ b/tools/yelp-build.in
@@ -196,21 +196,29 @@ yelp_html_xsl_common () {
     if [ "x$html_custom" != "x" ]; then
         echo '<xsl:include href="file://'`echo "$html_custom" | urlencode`'"/>'
     fi
-    echo '<xsl:variable name="yelp.locale">'
-    echo ' <xsl:choose>'
-    echo '  <xsl:when test="$l10n.locale != '"''"'">'
-    echo '   <xsl:value-of select="$l10n.locale"/>'
-    echo '  </xsl:when>'
-    echo '  <xsl:otherwise>'
-    echo '   <xsl:text>C</xsl:text>'
-    echo '  </xsl:otherwise>'
-    echo ' </xsl:choose>'
-    echo '</xsl:variable>'
     echo '<xsl:template name="html.css">'
     echo ' <xsl:param name="node" select="."/>'
+    echo ' <xsl:variable name="yelp.locale">'
+    echo '  <xsl:choose>'
+    echo '   <xsl:when test="$node/@xml:lang != '"''"'">'
+    echo '    <xsl:value-of select="$node/@xml:lang"/>'
+    echo '   </xsl:when>'
+    echo '   <xsl:when test="$node/@lang != '"''"'">'
+    echo '    <xsl:value-of select="$node/@lang"/>'
+    echo '   </xsl:when>'
+    echo '   <xsl:otherwise>'
+    echo '    <xsl:text>C</xsl:text>'
+    echo '   </xsl:otherwise>'
+    echo '  </xsl:choose>'
+    echo ' </xsl:variable>'
     echo ' <exsl:document href="{$yelp.internal.datadir}{$yelp.locale}.css" method="text">'
     echo '  <xsl:call-template name="html.css.content">'
     echo '   <xsl:with-param name="node" select="$node"/>'
+    echo '   <xsl:with-param name="direction">'
+    echo '    <xsl:call-template name="l10n.direction">'
+    echo '     <xsl:with-param name="lang" select="$yelp.locale"/>'
+    echo '    </xsl:call-template>'
+    echo '   </xsl:with-param>'
     echo '  </xsl:call-template>'
     echo ' </exsl:document>'
     echo ' <link rel="stylesheet" type="text/css" href="{$html.css.root}{$yelp.locale}.css"/>'
@@ -372,9 +380,9 @@ yelp_html_mal2html () {
         echo '<xsl:param name="mal.cache.file" select="'"'$html_cache_url'"'"/>'
         echo '<xsl:template match="/">'
         echo '<xsl:for-each select="cache:cache/mal:page">'
-        echo '<xsl:call-template name="html.output">'
-        echo '<xsl:with-param name="node" select="document(@cache:href)/mal:page"/>'
-        echo '</xsl:call-template>'
+        echo '<xsl:for-each select="document(@cache:href)/mal:page">'
+        echo '<xsl:call-template name="html.output"/>'
+        echo '</xsl:for-each>'
         echo '</xsl:for-each>'
         echo '</xsl:template>'
         echo '</xsl:stylesheet>'


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]