summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@redhat.com>2021-10-30 22:25:16 -0400
committerShaun McCance <shaunm@redhat.com>2021-10-30 22:25:16 -0400
commit4e30c9186f08f8f827ddb348a8139657215e293b (patch)
tree3f9931e45316718d53fe1d72fc130e7cd6b16729
parentcef8f0c8b0783abf98ba8a7c614d3254eda76ef6 (diff)
downloadyelp-xsl-4e30c9186f08f8f827ddb348a8139657215e293b.tar.gz
Avoid use of global l10n.locale parameter
Documents can have different languages at different levels. This is especially true with Mallard stack files, which could incorporate some translated documents, as well as some that have not yet been translated. Using a single global parameter completely breaks this.
-rw-r--r--doc/yelp-xsl/C/html.linktrails.prefix.page9
-rw-r--r--doc/yelp-xsl/C/l10n.direction.page19
-rw-r--r--doc/yelp-xsl/C/l10n.locale.page5
-rw-r--r--doc/yelp-xsl/C/mal2html.page.linktrails.link.page9
-rw-r--r--doc/yelp-xsl/C/mal2html.page.linktrails.trail.page9
-rw-r--r--doc/yelp-xsl/C/mal2html.page.linktrails.trail.prefix.page9
-rw-r--r--xslt/common/html.xsl31
-rw-r--r--xslt/common/l10n.xsl37
-rw-r--r--xslt/common/tmpl.xsl4
-rw-r--r--xslt/dita/html/dita2html-topic.xsl4
-rw-r--r--xslt/docbook/html/db2html-links.xsl4
-rw-r--r--xslt/mallard/html/mal2html-inline.xsl4
-rw-r--r--xslt/mallard/html/mal2html-list.xsl2
-rw-r--r--xslt/mallard/html/mal2html-page.xsl33
-rw-r--r--xslt/mallard/html/mal2html-ui.xsl4
15 files changed, 148 insertions, 35 deletions
diff --git a/doc/yelp-xsl/C/html.linktrails.prefix.page b/doc/yelp-xsl/C/html.linktrails.prefix.page
index cac488c2..a2bad3a6 100644
--- a/doc/yelp-xsl/C/html.linktrails.prefix.page
+++ b/doc/yelp-xsl/C/html.linktrails.prefix.page
@@ -5,13 +5,17 @@
<link type="guide" xref="templates" group="html"/>
<desc>Stub to output extra content before a link trail.</desc>
<link type="guide" xref="stubs" group="html"/>
- <revision version="3.28" date="2017-05-24" status="final"/>
+ <revision version="42" date="2021-10-30" status="final"/>
</info>
<title>html.linktrails.prefix</title>
<synopsis>
<title>Parameters</title>
<terms>
<item>
+ <title><code>$page</code></title>
+ <p>The source element for which an output page is being made.</p>
+ </item>
+ <item>
<title><code>$node</code></title>
<p>A source-specific element providing information about the link trail.</p>
</item>
@@ -20,4 +24,7 @@
<p>This template is a stub. It is called by templates that output link trails
before the normal links are output. This template is useful for adding extra
site links at the beginning of each link trail.</p>
+ <note style="plain">
+ <p>The <code>$page</code> parameter was added in version 42.</p>
+ </note>
</page>
diff --git a/doc/yelp-xsl/C/l10n.direction.page b/doc/yelp-xsl/C/l10n.direction.page
index c72782c1..e2c6f987 100644
--- a/doc/yelp-xsl/C/l10n.direction.page
+++ b/doc/yelp-xsl/C/l10n.direction.page
@@ -4,26 +4,35 @@
<link type="guide" xref="l10n" group="templates"/>
<link type="guide" xref="templates" group="l10n"/>
<desc>Determine the text direction for a language.</desc>
- <revision version="3.18" date="2015-08-13" status="final"/>
+ <revision version="42" date="2021-10-30" status="final"/>
</info>
<title>l10n.direction</title>
<synopsis>
<title>Parameters</title>
<terms>
<item>
+ <title><code>$node</code></title>
+ <p>The node to find the direction for.</p>
+ </item>
+ <item>
<title><code>$lang</code></title>
<p>The locale to use to determine the text direction.</p>
</item>
</terms>
</synopsis>
- <p>This template returns the text direction for the language <code>$lang</code>. It returns
- <sys>"ltr"</sys> for left-to-right languages and <sys>"rtl"</sys> for right-to-left languages.
- If <code>$lang</code> is not provided, it defaults to <code xref="l10n.locale">l10n.locale</code>, the top-level locale
- of the document.</p>
+ <p>This template returns the text direction for the language <code>$lang</code>. If <code>$lang</code> is
+ not provided, it looks for the nearest node to <code>$node</code> with a locale attribute,
+ either <sys>xml:lang</sys> or <sys>lang</sys>.</p>
+ <p>This template returns <sys>"ltr"</sys> for left-to-right languages and <sys>"rtl"</sys> for
+ right-to-left languages.</p>
<p>This template calls <code xref="l10n.gettext">l10n.gettext</code> with the string <sys>default:LTR</sys> in the domain
<sys>yelp-xsl</sys>. The language is right-to-left if the string <sys>default:RTL</sys> is
returned. Otherwise, it is left-to-right. (This particular string is used to
match the string used in GTK+, enabling translation memory.)</p>
+ <note style="plain">
+ <p>The <code>$node</code> parameter was added in version 42, and the default value of the
+ <code>$lang</code> parameter was changed accordingly.</p>
+ </note>
<list style="compact">
<title>Calls Parameters</title>
<item>
diff --git a/doc/yelp-xsl/C/l10n.locale.page b/doc/yelp-xsl/C/l10n.locale.page
index cdf007f8..940988c6 100644
--- a/doc/yelp-xsl/C/l10n.locale.page
+++ b/doc/yelp-xsl/C/l10n.locale.page
@@ -10,4 +10,9 @@
<p>This parameter provides the top-level locale of the document, taken from either
the <sys>xml:lang</sys> or the <sys>lang</sys> parameter of the root element. It holds the
locale exactly as specified in the document, with no normalization.</p>
+ <note style="warning">
+ <p>This parameter is deprecated. When processing multiple pages in a stack, you
+ cannot rely on a single global locale. Instead, when you need a locale, you
+ should look for an <sys>ancestor-or-self</sys> node with the appropriate attribute.</p>
+ </note>
</page>
diff --git a/doc/yelp-xsl/C/mal2html.page.linktrails.link.page b/doc/yelp-xsl/C/mal2html.page.linktrails.link.page
index 20d7b662..64c776ed 100644
--- a/doc/yelp-xsl/C/mal2html.page.linktrails.link.page
+++ b/doc/yelp-xsl/C/mal2html.page.linktrails.link.page
@@ -4,13 +4,17 @@
<link type="guide" xref="mal2html-page" group="templates"/>
<link type="guide" xref="templates" group="mal2html"/>
<desc>Output a link and the following links in a link trail.</desc>
- <revision version="3.4" date="2011-11-19" status="final"/>
+ <revision version="42" date="2021-11-19" status="final"/>
</info>
<title>mal2html.page.linktrails.link</title>
<synopsis>
<title>Parameters</title>
<terms>
<item>
+ <title><code>$page</code></title>
+ <p>The source element for which an output page is being made.</p>
+ </item>
+ <item>
<title><code>$node</code></title>
<p>A <sys>link</sys> element from <code xref="mal.link.linktrails">mal.link.linktrails</code>.</p>
</item>
@@ -27,6 +31,9 @@
<p>The <code>$direction</code> parameter specifies the current text directionality. If not
provided, it is computed automatically with <code xref="l10n.direction">l10n.direction</code>. It determines the
separators used between links.</p>
+ <note style="plain">
+ <p>The <code>$page</code> parameter was added in version 42.</p>
+ </note>
<list style="compact">
<title>Calls Templates</title>
<item>
diff --git a/doc/yelp-xsl/C/mal2html.page.linktrails.trail.page b/doc/yelp-xsl/C/mal2html.page.linktrails.trail.page
index 91519d20..546825b7 100644
--- a/doc/yelp-xsl/C/mal2html.page.linktrails.trail.page
+++ b/doc/yelp-xsl/C/mal2html.page.linktrails.trail.page
@@ -4,13 +4,17 @@
<link type="guide" xref="mal2html-page" group="templates"/>
<link type="guide" xref="templates" group="mal2html"/>
<desc>Output one trail of guide links.</desc>
- <revision version="3.20" date="2015-09-19" status="final"/>
+ <revision version="42" date="2021-10-30" status="final"/>
</info>
<title>mal2html.page.linktrails.trail</title>
<synopsis>
<title>Parameters</title>
<terms>
<item>
+ <title><code>$page</code></title>
+ <p>The source element for which an output page is being made.</p>
+ </item>
+ <item>
<title><code>$node</code></title>
<p>A <sys>link</sys> element from <code xref="mal.link.linktrails">mal.link.linktrails</code>.</p>
</item>
@@ -20,6 +24,9 @@
single link trail. It calls <code xref="html.linktrails.prefix">html.linktrails.prefix</code> (by way of
<code xref="mal2html.page.linktrails.trail.prefix">mal2html.page.linktrails.trail.prefix</code>) to output a custom boilerplate prefix,
then calls <code xref="mal2html.page.linktrails.link">mal2html.page.linktrails.link</code> to output the actual links.</p>
+ <note style="plain">
+ <p>The <code>$page</code> parameter was added in version 42.</p>
+ </note>
<list style="compact">
<title>Calls Templates</title>
<item>
diff --git a/doc/yelp-xsl/C/mal2html.page.linktrails.trail.prefix.page b/doc/yelp-xsl/C/mal2html.page.linktrails.trail.prefix.page
index 58a51cca..d7240ef1 100644
--- a/doc/yelp-xsl/C/mal2html.page.linktrails.trail.prefix.page
+++ b/doc/yelp-xsl/C/mal2html.page.linktrails.trail.prefix.page
@@ -7,11 +7,15 @@
</info>
<title>mal2html.page.linktrails.trail.prefix</title>
<p>:Stub: true
- @revision[version=3.20 date=2015-09-17 status=final]</p>
+ @revision[version=42 date=2021-10-30 status=final]</p>
<synopsis>
<title>Parameters</title>
<terms>
<item>
+ <title><code>$page</code></title>
+ <p>The source element for which an output page is being made.</p>
+ </item>
+ <item>
<title><code>$node</code></title>
<p>A <sys>link</sys> element from <code xref="mal.link.linktrails">mal.link.linktrails</code>.</p>
</item>
@@ -23,6 +27,9 @@
each link trail before the normal links are output with
<code xref="mal2html.page.linktrails.link">mal2html.page.linktrails.link</code>. This template is useful for adding extra site
links at the beginning of each link trail.</p>
+ <note style="plain">
+ <p>The <code>$page</code> parameter was added in version 42.</p>
+ </note>
<list style="compact">
<title>Calls Templates</title>
<item>
diff --git a/xslt/common/html.xsl b/xslt/common/html.xsl
index 272c3835..77aed075 100644
--- a/xslt/common/html.xsl
+++ b/xslt/common/html.xsl
@@ -878,16 +878,21 @@ trails would otherwise be present.
html.linktrails.prefix
Stub to output extra content before a link trail.
@xsl:stub
-@revision[version=3.28 date=2017-05-24 status=final]
+@revision[version=42 date=2021-10-30 status=final]
[xsl:params]
+$page: The source element for which an output page is being made.
$node: A source-specific element providing information about the link trail.
This template is a stub. It is called by templates that output link trails
before the normal links are output. This template is useful for adding extra
site links at the beginning of each link trail.
+
+[note .plain]
+The $page parameter was added in version 42.
-->
<xsl:template name="html.linktrails.prefix">
+ <xsl:param name="page" select="."/>
<xsl:param name="node" select="."/>
</xsl:template>
@@ -1104,7 +1109,9 @@ dimensions. All parameters can be automatically computed if not provided.
<xsl:template name="html.css">
<xsl:param name="node" select="."/>
<xsl:param name="direction">
- <xsl:call-template name="l10n.direction"/>
+ <xsl:call-template name="l10n.direction">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</xsl:param>
<xsl:param name="left">
<xsl:call-template name="l10n.align.start">
@@ -1146,7 +1153,9 @@ calls the template {html.css.custom}.
<xsl:template name="html.css.content">
<xsl:param name="node" select="."/>
<xsl:param name="direction">
- <xsl:call-template name="l10n.direction"/>
+ <xsl:call-template name="l10n.direction">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</xsl:param>
<xsl:param name="left">
<xsl:call-template name="l10n.align.start">
@@ -1248,7 +1257,9 @@ All parameters can be automatically computed if not provided.
<xsl:template name="html.css.core">
<xsl:param name="node" select="."/>
<xsl:param name="direction">
- <xsl:call-template name="l10n.direction"/>
+ <xsl:call-template name="l10n.direction">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</xsl:param>
<xsl:param name="left">
<xsl:call-template name="l10n.align.start">
@@ -1296,7 +1307,9 @@ All parameters can be automatically computed if not provided.
<xsl:template name="html.css.elements">
<xsl:param name="node" select="."/>
<xsl:param name="direction">
- <xsl:call-template name="l10n.direction"/>
+ <xsl:call-template name="l10n.direction">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</xsl:param>
<xsl:param name="left">
<xsl:call-template name="l10n.align.start">
@@ -1411,7 +1424,9 @@ All parameters can be automatically computed if not provided.
<xsl:template name="html.css.syntax">
<xsl:param name="node" select="."/>
<xsl:param name="direction">
- <xsl:call-template name="l10n.direction"/>
+ <xsl:call-template name="l10n.direction">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</xsl:param>
<xsl:param name="left">
<xsl:call-template name="l10n.align.start">
@@ -1453,7 +1468,9 @@ template to provide additional CSS that will be used by all HTML output.
<xsl:template name="html.css.custom">
<xsl:param name="node" select="."/>
<xsl:param name="direction">
- <xsl:call-template name="l10n.direction"/>
+ <xsl:call-template name="l10n.direction">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</xsl:param>
<xsl:param name="left">
<xsl:call-template name="l10n.align.start">
diff --git a/xslt/common/l10n.xsl b/xslt/common/l10n.xsl
index 3d1c87d4..c45eb69b 100644
--- a/xslt/common/l10n.xsl
+++ b/xslt/common/l10n.xsl
@@ -63,6 +63,11 @@ The top-level locale of the document.
This parameter provides the top-level locale of the document, taken from either
the `xml:lang` or the `lang` parameter of the root element. It holds the
locale exactly as specified in the document, with no normalization.
+
+[note .warning]
+This parameter is deprecated. When processing multiple pages in a stack, you
+cannot rely on a single global locale. Instead, when you need a locale, you
+should look for an `ancestor-or-self` node with the appropriate attribute.
-->
<xsl:param name="l10n.locale">
<xsl:choose>
@@ -508,23 +513,43 @@ as well as the plural rules in the Unicode CLDR.
<!--**==========================================================================
l10n.direction
Determine the text direction for a language.
-@revision[version=3.18 date=2015-08-13 status=final]
+@revision[version=42 date=2021-10-30 status=final]
[xsl:params]
+$node: The node to find the direction for.
$lang: The locale to use to determine the text direction.
-This template returns the text direction for the language $lang. It returns
-`"ltr"` for left-to-right languages and `"rtl"` for right-to-left languages.
-If $lang is not provided, it defaults to {l10n.locale}, the top-level locale
-of the document.
+This template returns the text direction for the language $lang. If $lang is
+not provided, it looks for the nearest node to $node with a locale attribute,
+either `xml:lang` or `lang`.
+
+This template returns `"ltr"` for left-to-right languages and `"rtl"` for
+right-to-left languages.
This template calls {l10n.gettext} with the string `default:LTR` in the domain
`yelp-xsl`. The language is right-to-left if the string `default:RTL` is
returned. Otherwise, it is left-to-right. (This particular string is used to
match the string used in GTK+, enabling translation memory.)
+
+[note .plain]
+The $node parameter was added in version 42, and the default value of the
+$lang parameter was changed accordingly.
-->
<xsl:template name="l10n.direction">
- <xsl:param name="lang" select="$l10n.locale"/>
+ <xsl:param name="node" select="."/>
+ <xsl:param name="lang">
+ <xsl:choose>
+ <xsl:when test="$node/ancestor-or-self::*[@xml:lang]">
+ <xsl:value-of select="$node/ancestor-or-self::*[@xml:lang][1]/@xml:lang"/>
+ </xsl:when>
+ <xsl:when test="$node/ancestor-or-self::*[@lang]">
+ <xsl:value-of select="$node/ancestor-or-self::*[@lang][1]/@xml:lang"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$l10n.locale"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:param>
<xsl:variable name="direction">
<xsl:for-each select="/*">
<xsl:call-template name="l10n.gettext">
diff --git a/xslt/common/tmpl.xsl b/xslt/common/tmpl.xsl
index c52a95cf..7e0f2693 100644
--- a/xslt/common/tmpl.xsl
+++ b/xslt/common/tmpl.xsl
@@ -72,7 +72,9 @@ This template was added in version 40.
<xsl:param name="file"/>
<xsl:param name="node" select="."/>
<xsl:param name="direction">
- <xsl:call-template name="l10n.direction"/>
+ <xsl:call-template name="l10n.direction">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</xsl:param>
<xsl:param name="left">
<xsl:call-template name="l10n.align.start">
diff --git a/xslt/dita/html/dita2html-topic.xsl b/xslt/dita/html/dita2html-topic.xsl
index da8c1db3..5b6ba998 100644
--- a/xslt/dita/html/dita2html-topic.xsl
+++ b/xslt/dita/html/dita2html-topic.xsl
@@ -387,7 +387,9 @@ html.sidebar.sections.mode
<xsl:template mode="html.header.mode" match="&map_topicref;">
<xsl:variable name="node" select="."/>
<xsl:variable name="direction">
- <xsl:call-template name="l10n.direction"/>
+ <xsl:call-template name="l10n.direction">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</xsl:variable>
<xsl:variable name="sep">
<xsl:choose>
diff --git a/xslt/docbook/html/db2html-links.xsl b/xslt/docbook/html/db2html-links.xsl
index 684451a7..97914bed 100644
--- a/xslt/docbook/html/db2html-links.xsl
+++ b/xslt/docbook/html/db2html-links.xsl
@@ -45,7 +45,9 @@ as that template's `node` parameter.
<xsl:template name="db2html.links.linktrail">
<xsl:param name="node" select="."/>
<xsl:variable name="direction">
- <xsl:call-template name="l10n.direction"/>
+ <xsl:call-template name="l10n.direction">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$node/ancestor::*">
diff --git a/xslt/mallard/html/mal2html-inline.xsl b/xslt/mallard/html/mal2html-inline.xsl
index 4eeebc58..e0d25d5e 100644
--- a/xslt/mallard/html/mal2html-inline.xsl
+++ b/xslt/mallard/html/mal2html-inline.xsl
@@ -185,9 +185,7 @@ an `xref` or `href` attribute.
<xsl:template mode="mal2html.inline.content.mode" match="mal:guiseq">
<xsl:variable name="arrow">
<xsl:variable name="dir">
- <xsl:call-template name="l10n.direction">
- <xsl:with-param name="lang" select="ancestor-or-self::*[@xml:lang][1]/@xml:lang"/>
- </xsl:call-template>
+ <xsl:call-template name="l10n.direction"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$dir = 'rtl'">
diff --git a/xslt/mallard/html/mal2html-list.xsl b/xslt/mallard/html/mal2html-list.xsl
index 59c8b112..3034cc42 100644
--- a/xslt/mallard/html/mal2html-list.xsl
+++ b/xslt/mallard/html/mal2html-list.xsl
@@ -367,7 +367,7 @@ neighboring `item` elements, and passes that prefix to child elements.
<xsl:if test="$lines">
<xsl:variable name="dir">
<xsl:call-template name="l10n.direction">
- <xsl:with-param name="lang" select="$item/ancestor-or-self::*[@xml:lang][1]/@xml:lang"/>
+ <xsl:with-param name="node" select="$item"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="translate(translate(translate(translate(
diff --git a/xslt/mallard/html/mal2html-page.xsl b/xslt/mallard/html/mal2html-page.xsl
index 4faf6d36..19c0d2a8 100644
--- a/xslt/mallard/html/mal2html-page.xsl
+++ b/xslt/mallard/html/mal2html-page.xsl
@@ -251,7 +251,9 @@ on each one. Otherwise, it calls the stub template {mal2html.page.linktrails.emp
<xsl:sort select="(.//mal:title[@type='sort'])[3]"/>
<xsl:sort select="(.//mal:title[@type='sort'])[4]"/>
<xsl:sort select="(.//mal:title[@type='sort'])[5]"/>
- <xsl:call-template name="mal2html.page.linktrails.trail"/>
+ <xsl:call-template name="mal2html.page.linktrails.trail">
+ <xsl:with-param name="page" select="$node"/>
+ </xsl:call-template>
</xsl:for-each>
</div>
</xsl:when>
@@ -292,23 +294,30 @@ trails would otherwise be present.
<!--**==========================================================================
mal2html.page.linktrails.trail
Output one trail of guide links.
-@revision[version=3.20 date=2015-09-19 status=final]
+@revision[version=42 date=2021-10-30 status=final]
[xsl:params]
+$page: The source element for which an output page is being made.
$node: A `link` element from {mal.link.linktrails}.
This template outputs an HTML `div` element containing all the links in a
single link trail. It calls {html.linktrails.prefix} (by way of
{mal2html.page.linktrails.trail.prefix}) to output a custom boilerplate prefix,
then calls {mal2html.page.linktrails.link} to output the actual links.
+
+[note .plain]
+The $page parameter was added in version 42.
-->
<xsl:template name="mal2html.page.linktrails.trail">
+ <xsl:param name="page" select="."/>
<xsl:param name="node" select="."/>
<div class="trail">
<xsl:call-template name="mal2html.page.linktrails.trail.prefix">
+ <xsl:with-param name="page" select="$page"/>
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<xsl:call-template name="mal2html.page.linktrails.link">
+ <xsl:with-param name="page" select="$page"/>
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</div>
@@ -319,9 +328,10 @@ then calls {mal2html.page.linktrails.link} to output the actual links.
mal2html.page.linktrails.trail.prefix
Deprecated stub to output extra content before a link trail.
:Stub: true
-@revision[version=3.20 date=2015-09-17 status=final]
+@revision[version=42 date=2021-10-30 status=final]
[xsl:params]
+$page: The source element for which an output page is being made.
$node: A `link` element from {mal.link.linktrails}.
This template is deprecated. Use {html.linktrails.prefix} instead. By default,
@@ -331,10 +341,15 @@ This template is a stub. It is called by {mal2html.page.linktrails.trail} for
each link trail before the normal links are output with
{mal2html.page.linktrails.link}. This template is useful for adding extra site
links at the beginning of each link trail.
+
+[note .plain]
+The $page parameter was added in version 42.
-->
<xsl:template name="mal2html.page.linktrails.trail.prefix">
+ <xsl:param name="page" select="."/>
<xsl:param name="node" select="."/>
<xsl:call-template name="html.linktrails.prefix">
+ <xsl:with-param name="page" select="$page"/>
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</xsl:template>
@@ -343,9 +358,10 @@ links at the beginning of each link trail.
<!--**==========================================================================
mal2html.page.linktrails.link
Output a link and the following links in a link trail.
-@revision[version=3.4 date=2011-11-19 status=final]
+@revision[version=42 date=2021-11-19 status=final]
[xsl:params]
+$page: The source element for which an output page is being made.
$node: A `link` element from {mal.link.linktrails}.
$direction: The text directionality.
@@ -357,11 +373,17 @@ element, then calls itself recursively on the child `link` element, if it exists
The $direction parameter specifies the current text directionality. If not
provided, it is computed automatically with {l10n.direction}. It determines the
separators used between links.
+
+[note .plain]
+The $page parameter was added in version 42.
-->
<xsl:template name="mal2html.page.linktrails.link">
+ <xsl:param name="page" select="."/>
<xsl:param name="node" select="."/>
<xsl:param name="direction">
- <xsl:call-template name="l10n.direction"/>
+ <xsl:call-template name="l10n.direction">
+ <xsl:with-param name="node" select="$page"/>
+ </xsl:call-template>
</xsl:param>
<a class="trail">
<xsl:attribute name="href">
@@ -397,6 +419,7 @@ separators used between links.
</xsl:if>
<xsl:for-each select="$node/mal:link">
<xsl:call-template name="mal2html.page.linktrails.link">
+ <xsl:with-param name="page" select="$page"/>
<xsl:with-param name="direction" select="$direction"/>
</xsl:call-template>
</xsl:for-each>
diff --git a/xslt/mallard/html/mal2html-ui.xsl b/xslt/mallard/html/mal2html-ui.xsl
index 7fa0a042..5ecd22b2 100644
--- a/xslt/mallard/html/mal2html-ui.xsl
+++ b/xslt/mallard/html/mal2html-ui.xsl
@@ -100,7 +100,9 @@ http://projectmallard.org/ui/1.0/ui_expanded.html</xsl:text>
<xsl:variable name="title_c" select="$node/mal:info/mal:title[@type = 'ui:collapsed'][1]"/>
<div class="yelp-data yelp-data-ui-expander">
<xsl:attribute name="dir">
- <xsl:call-template name="l10n.direction"/>
+ <xsl:call-template name="l10n.direction">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</xsl:attribute>
<xsl:attribute name="data-yelp-expanded">
<xsl:choose>