summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog15
-rw-r--r--doc/xslt/C/gnome-doc-xslt.xml1
-rw-r--r--doc/xslt/C/translating.xml2
-rw-r--r--xslt/docbook/common/Makefile.am1
-rw-r--r--xslt/docbook/common/db-format.xml.in114
-rw-r--r--xslt/docbook/common/db-xref.xsl25
-rw-r--r--xslt/docbook/html/db2html-division.xsl8
-rw-r--r--xslt/docbook/html/db2html.xsl1
-rw-r--r--xslt/gettext/format2xsl.xsl35
9 files changed, 89 insertions, 113 deletions
diff --git a/ChangeLog b/ChangeLog
index 96506a5..a910424 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2005-01-02 Shaun McCance <shaunm@gnome.org>
+
+ * doc/xslt/C/gnome-doc-xslt.xml:
+ * xslt/docbook/common/Makefile.am:
+ * xslt/docbook/common/db-format.xml.in:
+ * xslt/docbook/common/db-xref.xsl:
+ * xslt/docbook/html/db2html-division.xsl:
+ * xslt/docbook/html/db2html.xsl:
+ * xslt/gettext/format2xsl.xsl:
+ - Added db-title.xsl to ease title getting
+ - Automatically output title, titleabbrev, and subtitle roles
+
+ * doc/xslt/C/translating.xml:
+ - Fixed typo
+
2005-01-01 Shaun McCance <shaunm@gnome.org>
* bootstrap.make:
diff --git a/doc/xslt/C/gnome-doc-xslt.xml b/doc/xslt/C/gnome-doc-xslt.xml
index 2f7603a..a2bc385 100644
--- a/doc/xslt/C/gnome-doc-xslt.xml
+++ b/doc/xslt/C/gnome-doc-xslt.xml
@@ -42,6 +42,7 @@
<include href="db-chunk.xml" xmlns="http://www.w3.org/2001/XInclude"/>
<include href="db-common.xml" xmlns="http://www.w3.org/2001/XInclude"/>
<include href="db-label.xml" xmlns="http://www.w3.org/2001/XInclude"/>
+ <include href="db-title.xml" xmlns="http://www.w3.org/2001/XInclude"/>
<include href="db-xref.xml" xmlns="http://www.w3.org/2001/XInclude"/>
<include href="db2omf.xml" xmlns="http://www.w3.org/2001/XInclude"/>
<include href="rngdoc.xml" xmlns="http://www.w3.org/2001/XInclude"/>
diff --git a/doc/xslt/C/translating.xml b/doc/xslt/C/translating.xml
index b90b288..a386871 100644
--- a/doc/xslt/C/translating.xml
+++ b/doc/xslt/C/translating.xml
@@ -209,7 +209,7 @@ msgstr ""
conditions, such as the grammatical role. For these cases, the
&format2xsl; template can select localized format strings from a
list of alternatives, each marked with a
- <sgmltag role="attribute">attribute</sgmltag> attribute. The list
+ <sgmltag role="attribute">role</sgmltag> attribute. The list
of valid roles will depend on the template; however, there are a
number of common cases, particularly for automatically generated
labels.</para>
diff --git a/xslt/docbook/common/Makefile.am b/xslt/docbook/common/Makefile.am
index ede322a..b978011 100644
--- a/xslt/docbook/common/Makefile.am
+++ b/xslt/docbook/common/Makefile.am
@@ -12,6 +12,7 @@ xsl_DATA = \
db-common.xsl \
db-format.xsl \
db-label.xsl \
+ db-title.xsl \
db-xref.xsl
EXTRA_DIST=$(xsl_DATA) db-format.xml.in db-format.xml
diff --git a/xslt/docbook/common/db-format.xml.in b/xslt/docbook/common/db-format.xml.in
index ee4803f..02c8f23 100644
--- a/xslt/docbook/common/db-format.xml.in
+++ b/xslt/docbook/common/db-format.xml.in
@@ -221,9 +221,8 @@
<!-- Appendix %t{number} -->
<_msg:msgstr>format.appendix.label</_msg:msgstr>
<msg:msgstr xml:lang="C">
- <msg:msgstr role="header">%t{number}&#x2003;</msg:msgstr>
+ <msg:msgstr role="header">%t{number}.&#x2003;</msg:msgstr>
<msg:msgstr role="li">%t{number}.&#x2002;</msg:msgstr>
- <msg:msgstr role="title">%t{title}</msg:msgstr>
<msg:msgstr role="xref">Appendix %t{number} ― %t{title}</msg:msgstr>
<msg:msgstr>Appendix %t{number}</msg:msgstr>
</msg:msgstr>
@@ -234,14 +233,9 @@
</xsl:call-template>
</msg:arg>
<msg:arg name="title">
- <xsl:choose>
- <xsl:when test="$node/titleabbrev">
- <xsl:apply-templates select="$node/titleabbrev/node()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$node/title/node()"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:call-template name="db.title">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</msg:arg>
</xsl:template>
@@ -274,9 +268,8 @@
<!-- Chapter %t{number} -->
<_msg:msgstr>format.chapter.label</_msg:msgstr>
<msg:msgstr xml:lang="C">
- <msg:msgstr role="header">%t{number}&#x2003;</msg:msgstr>
+ <msg:msgstr role="header">%t{number}.&#x2003;</msg:msgstr>
<msg:msgstr role="li">%t{number}.&#x2002;</msg:msgstr>
- <msg:msgstr role="title">%t{title}</msg:msgstr>
<msg:msgstr role="xref">Chapter %t{number} ― %t{title}</msg:msgstr>
<msg:msgstr>Chapter %t{number}</msg:msgstr>
</msg:msgstr>
@@ -287,14 +280,9 @@
</xsl:call-template>
</msg:arg>
<msg:arg name="title">
- <xsl:choose>
- <xsl:when test="$node/titleabbrev">
- <xsl:apply-templates select="$node/titleabbrev/node()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$node/title/node()"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:call-template name="db.title">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</msg:arg>
</xsl:template>
@@ -328,7 +316,6 @@
<_msg:msgstr>format.example.label</_msg:msgstr>
<msg:msgstr xml:lang="C">
<msg:msgstr role="header"><i>Example %t{number}</i>&#x2003;</msg:msgstr>
- <msg:msgstr role="title">%t{title}</msg:msgstr>
<msg:msgstr>Example %t{number}</msg:msgstr>
</msg:msgstr>
</msg:msg>
@@ -338,14 +325,9 @@
</xsl:call-template>
</msg:arg>
<msg:arg name="title">
- <xsl:choose>
- <xsl:when test="$node/titleabbrev">
- <xsl:apply-templates select="$node/titleabbrev/node()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$node/title/node()"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:call-template name="db.title">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</msg:arg>
</xsl:template>
@@ -379,7 +361,6 @@
<_msg:msgstr>format.figure.label</_msg:msgstr>
<msg:msgstr xml:lang="C">
<msg:msgstr role="header"><i>Figure %t{number}</i>&#x2003;</msg:msgstr>
- <msg:msgstr role="title">%t{title}</msg:msgstr>
<msg:msgstr>Figure %t{number}</msg:msgstr>
</msg:msgstr>
</msg:msg>
@@ -389,14 +370,9 @@
</xsl:call-template>
</msg:arg>
<msg:arg name="title">
- <xsl:choose>
- <xsl:when test="$node/titleabbrev">
- <xsl:apply-templates select="$node/titleabbrev/node()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$node/title/node()"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:call-template name="db.title">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</msg:arg>
</xsl:template>
@@ -457,9 +433,8 @@
<!-- Part %t{number} -->
<_msg:msgstr>format.part.label</_msg:msgstr>
<msg:msgstr xml:lang="C">
- <msg:msgstr role="header">%t{number}&#x2003;</msg:msgstr>
- <msg:msgstr role="li">%t{number}&#x2002;</msg:msgstr>
- <msg:msgstr role="title">%t{title}</msg:msgstr>
+ <msg:msgstr role="header">%t{number}.&#x2003;</msg:msgstr>
+ <msg:msgstr role="li">%t{number}.&#x2002;</msg:msgstr>
<msg:msgstr role="xref">Part %t{number} ― %t{title}</msg:msgstr>
<msg:msgstr>Part %t{number}</msg:msgstr>
</msg:msgstr>
@@ -470,14 +445,9 @@
</xsl:call-template>
</msg:arg>
<msg:arg name="title">
- <xsl:choose>
- <xsl:when test="$node/titleabbrev">
- <xsl:apply-templates select="$node/titleabbrev/node()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$node/title/node()"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:call-template name="db.title">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</msg:arg>
</xsl:template>
@@ -510,28 +480,14 @@
<!-- %t{title} -->
<_msg:msgstr>format.refentry.label</_msg:msgstr>
<msg:msgstr xml:lang="C">
- <msg:msgstr role="title">%t{title}</msg:msgstr>
<msg:msgstr role="xref">%t{title}</msg:msgstr>
<msg:msgstr>%t{title}</msg:msgstr>
</msg:msgstr>
</msg:msg>
<msg:arg name="title">
- <xsl:choose>
- <xsl:when test="refmeta/refentrytitle">
- <xsl:apply-templates select="refmeta/refentrytitle/node()"/>
- <xsl:if test="refmeta/manvolnum">
- <xsl:call-template name="format.manvolnum">
- <xsl:with-param name="node" select="refmeta/manvolnum[1]"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:when test="refentryinfo/title">
- <xsl:apply-templates select="refentryinfo/title/node()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="refnamediv/refname[1]/node()"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:call-template name="db.title">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</msg:arg>
</xsl:template>
@@ -564,9 +520,8 @@
<!-- Section %t{number} -->
<_msg:msgstr>format.section.label</_msg:msgstr>
<msg:msgstr xml:lang="C">
- <msg:msgstr role="header">%t{number}&#x2003;</msg:msgstr>
+ <msg:msgstr role="header">%t{number}.&#x2003;</msg:msgstr>
<msg:msgstr role="li">%t{number}.&#x2002;</msg:msgstr>
- <msg:msgstr role="title">%t{title}</msg:msgstr>
<msg:msgstr role="xref">Section %t{number} ― %t{title}</msg:msgstr>
<msg:msgstr>Section %t{number}</msg:msgstr>
</msg:msgstr>
@@ -577,14 +532,9 @@
</xsl:call-template>
</msg:arg>
<msg:arg name="title">
- <xsl:choose>
- <xsl:when test="$node/titleabbrev">
- <xsl:apply-templates select="$node/titleabbrev/node()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$node/title/node()"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:call-template name="db.title">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</msg:arg>
</xsl:template>
@@ -618,7 +568,6 @@
<_msg:msgstr>format.table.label</_msg:msgstr>
<msg:msgstr xml:lang="C">
<msg:msgstr role="header"><i>Table %t{number}</i>&#x2003;</msg:msgstr>
- <msg:msgstr role="title">%t{title}</msg:msgstr>
<msg:msgstr>Table %t{number}</msg:msgstr>
</msg:msgstr>
</msg:msg>
@@ -628,14 +577,9 @@
</xsl:call-template>
</msg:arg>
<msg:arg name="title">
- <xsl:choose>
- <xsl:when test="$node/titleabbrev">
- <xsl:apply-templates select="$node/titleabbrev/node()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$node/title/node()"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:call-template name="db.title">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
</msg:arg>
</xsl:template>
diff --git a/xslt/docbook/common/db-xref.xsl b/xslt/docbook/common/db-xref.xsl
index 0e5950f..13ac005 100644
--- a/xslt/docbook/common/db-xref.xsl
+++ b/xslt/docbook/common/db-xref.xsl
@@ -142,8 +142,10 @@
<xsl:template mode="db.xref.tooltip.mode" match="*" priority="-1"/>
-<xsl:template mode="db.xref.tooltip.mode" match="*[title]">
- <xsl:value-of select="normalize-space(title)"/>
+<xsl:template mode="db.xref.tooltip.mode" match="*">
+ <xsl:call-template name="db.title">
+ <xsl:with-param name="node" select="."/>
+ </xsl:call-template>
</xsl:template>
<xsl:template mode="db.xref.tooltip.mode" match="glossentry">
@@ -152,23 +154,4 @@
</xsl:call-template>
</xsl:template>
-<xsl:template mode="db.xref.tooltip.mode" match="refentry">
- <xsl:choose>
- <xsl:when test="refmeta/refentrytitle">
- <xsl:value-of select="normalize-space(refmeta/refentrytitle)"/>
- <xsl:if test="refmeta/manvolnum">
- <xsl:call-template name="format.manvolnum">
- <xsl:with-param name="node" select="refmeta/manvolnum[1]"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:when test="refentryinfo/title">
- <xsl:value-of select="normalize-space(refentryinfo/title)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="normalize-space(refnamediv/refname[1])"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
</xsl:stylesheet>
diff --git a/xslt/docbook/html/db2html-division.xsl b/xslt/docbook/html/db2html-division.xsl
index 92a4026..16b3210 100644
--- a/xslt/docbook/html/db2html-division.xsl
+++ b/xslt/docbook/html/db2html-division.xsl
@@ -74,6 +74,14 @@
<!-- FIXME -->
<html>
<head>
+ <title>
+ <xsl:variable name="title">
+ <xsl:call-template name="db.title">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="normalize-space($title)"/>
+ </title>
<xsl:call-template name="db2html.css"/>
</head>
<body>
diff --git a/xslt/docbook/html/db2html.xsl b/xslt/docbook/html/db2html.xsl
index 6fe71e6..74cf0b5 100644
--- a/xslt/docbook/html/db2html.xsl
+++ b/xslt/docbook/html/db2html.xsl
@@ -17,6 +17,7 @@
<xsl:include href="../common/db-common.xsl" doc:summary="true"/>
<xsl:include href="../common/db-format.xsl" doc:summary="true"/>
<xsl:include href="../common/db-label.xsl" doc:summary="true"/>
+<xsl:include href="../common/db-title.xsl" doc:summary="true"/>
<xsl:include href="../common/db-xref.xsl" doc:summary="true"/>
<xsl:include href="db2html-admon.xsl"
diff --git a/xslt/gettext/format2xsl.xsl b/xslt/gettext/format2xsl.xsl
index 0fedd28..630147e 100644
--- a/xslt/gettext/format2xsl.xsl
+++ b/xslt/gettext/format2xsl.xsl
@@ -133,6 +133,27 @@
</xsl:apply-templates>
</xslt:when>
</xsl:for-each>
+ <xsl:if test="not(msg:msgstr[@role = 'title'])">
+ <xslt:when test="$role = 'title'">
+ <xslt:call-template name="db.title">
+ <xslt:with-param name="node" select="$node"/>
+ </xslt:call-template>
+ </xslt:when>
+ </xsl:if>
+ <xsl:if test="not(msg:msgstr[@role = 'titleabbrev'])">
+ <xslt:when test="$role = 'titleabbrev'">
+ <xslt:call-template name="db.titleabbrev">
+ <xslt:with-param name="node" select="$node"/>
+ </xslt:call-template>
+ </xslt:when>
+ </xsl:if>
+ <xsl:if test="not(msg:msgstr[@role = 'subtitle'])">
+ <xslt:when test="$role = 'subtitle'">
+ <xslt:call-template name="db.subtitle">
+ <xslt:with-param name="node" select="$node"/>
+ </xslt:call-template>
+ </xslt:when>
+ </xsl:if>
<xsl:choose>
<xsl:when test="msg:msgstr[not(@role)]">
<xslt:otherwise>
@@ -144,12 +165,14 @@
</xslt:otherwise>
</xsl:when>
<xsl:otherwise>
- <xslt:message>
- <xslt:text>No translation for </xslt:text>
- <xslt:text><xsl:value-of select="$template/@name"/></xslt:text>
- <xslt:text> with role </xslt:text>
- <xslt:value-of select="$role"/>
- </xslt:message>
+ <xslt:otherwise>
+ <xslt:message>
+ <xslt:text>No translation for </xslt:text>
+ <xslt:text><xsl:value-of select="$template/@name"/></xslt:text>
+ <xslt:text> with role </xslt:text>
+ <xslt:value-of select="$role"/>
+ </xslt:message>
+ </xslt:otherwise>
</xsl:otherwise>
</xsl:choose>
</xslt:choose>