[yelp-xsl] Accessible titles on notes in DocBook and Mallard, #613267



commit e7f8d0446d4fd25a6fa16606c659ca6375b0da75
Author: Shaun McCance <shaunm gnome org>
Date:   Fri Jun 17 11:30:19 2011 -0400

    Accessible titles on notes in DocBook and Mallard, #613267

 xslt/docbook/html/db2html-block.xsl  |   43 +++++++++++++-
 xslt/gettext/domains/yelp-xsl.pot    |  107 ++++++++++++++++++++++-----------
 xslt/gettext/domains/yelp-xsl.xml.in |   35 +++++++++++
 xslt/mallard/html/mal2html-block.xsl |   24 +++++---
 4 files changed, 164 insertions(+), 45 deletions(-)
---
diff --git a/xslt/docbook/html/db2html-block.xsl b/xslt/docbook/html/db2html-block.xsl
index e488c33..bd53a47 100644
--- a/xslt/docbook/html/db2html-block.xsl
+++ b/xslt/docbook/html/db2html-block.xsl
@@ -44,7 +44,8 @@ $class: An extra string to insert in the #{class} attribute.
 $verbatim: Whether to maintain whitespace as written.
 $formal: Whether this is a formal block element.
 $title: When ${formal} is true, an element to use for the title.
-$caption: When ${formal} is true, an element to use for the caption .
+$caption: When ${formal} is true, an element to use for the caption.
+$titleattr: An optional value for the HTML #{title} attribute.
 
 This template creates an HTML #{div} element for the given DocBook element.
 This template uses the parameters to construct the #{class} attribute, which
@@ -66,6 +67,7 @@ formatted with a fixed-width font.
   <xsl:param name="title" select="$node/title | $node/db:title |
                                   $node/db:info/db:title"/>
   <xsl:param name="caption" select="$node/caption | $node/db:caption"/>
+  <xsl:param name="titleattr" select="''"/>
 
   <div>
     <xsl:attribute name="class">
@@ -74,6 +76,11 @@ formatted with a fixed-width font.
         <xsl:text> verbatim</xsl:text>
       </xsl:if>
     </xsl:attribute>
+    <xsl:if test="$titleattr != ''">
+      <xsl:attribute name="title">
+        <xsl:value-of select="$titleattr"/>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:call-template name="html.lang.attrs">
       <xsl:with-param name="node" select="$node"/>
     </xsl:call-template>
@@ -402,6 +409,11 @@ syntax highlighting support based on the #{language} attribute of ${node}.
   <xsl:call-template name="db2html.block">
     <xsl:with-param name="class" select="'note note-warning'"/>
     <xsl:with-param name="formal" select="true()"/>
+    <xsl:with-param name="titleattr">
+      <xsl:call-template name="l10n.gettext">
+        <xsl:with-param name="msgid" select="'Warning'"/>
+      </xsl:call-template>
+    </xsl:with-param>
   </xsl:call-template>
 </xsl:template>
 
@@ -541,6 +553,11 @@ syntax highlighting support based on the #{language} attribute of ${node}.
   <xsl:call-template name="db2html.block">
     <xsl:with-param name="class" select="'note note-important'"/>
     <xsl:with-param name="formal" select="true()"/>
+    <xsl:with-param name="titleattr">
+      <xsl:call-template name="l10n.gettext">
+        <xsl:with-param name="msgid" select="'Important'"/>
+      </xsl:call-template>
+    </xsl:with-param>
   </xsl:call-template>
 </xsl:template>
 
@@ -571,6 +588,20 @@ syntax highlighting support based on the #{language} attribute of ${node}.
       </xsl:if>
     </xsl:with-param>
     <xsl:with-param name="formal" select="true()"/>
+    <xsl:with-param name="titleattr">
+      <xsl:choose>
+        <xsl:when test="@role = 'bug'">
+          <xsl:call-template name="l10n.gettext">
+            <xsl:with-param name="msgid" select="'Bug'"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="l10n.gettext">
+            <xsl:with-param name="msgid" select="'Note'"/>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:with-param>
   </xsl:call-template>
 </xsl:template>
 
@@ -606,6 +637,11 @@ syntax highlighting support based on the #{language} attribute of ${node}.
   <xsl:call-template name="db2html.block">
     <xsl:with-param name="class" select="'note note-tip'"/>
     <xsl:with-param name="formal" select="true()"/>
+    <xsl:with-param name="titleattr">
+      <xsl:call-template name="l10n.gettext">
+        <xsl:with-param name="msgid" select="'Tip'"/>
+      </xsl:call-template>
+    </xsl:with-param>
   </xsl:call-template>
 </xsl:template>
 
@@ -622,6 +658,11 @@ syntax highlighting support based on the #{language} attribute of ${node}.
   <xsl:call-template name="db2html.block">
     <xsl:with-param name="class" select="'note note-warning'"/>
     <xsl:with-param name="formal" select="true()"/>
+    <xsl:with-param name="titleattr">
+      <xsl:call-template name="l10n.gettext">
+        <xsl:with-param name="msgid" select="'Warning'"/>
+      </xsl:call-template>
+    </xsl:with-param>
   </xsl:call-template>
 </xsl:template>
 
diff --git a/xslt/gettext/domains/yelp-xsl.pot b/xslt/gettext/domains/yelp-xsl.pot
index 04913ae..bb428da 100644
--- a/xslt/gettext/domains/yelp-xsl.pot
+++ b/xslt/gettext/domains/yelp-xsl.pot
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2011-06-10 15:29-0400\n"
+"POT-Creation-Date: 2011-06-17 11:28-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL ADDRESS>\n"
 "Language-Team: LANGUAGE <LL li org>\n"
@@ -79,122 +79,142 @@ msgstr ""
 msgid "A:"
 msgstr ""
 
-#. Default title for a bibliography.
+#. Accessible title for an advanced note.
 #: yelp-xsl.xml.in:100(msg/msgstr)
+msgid "Advanced"
+msgstr ""
+
+#. Default title for a bibliography.
+#: yelp-xsl.xml.in:105(msg/msgstr)
 msgid "Bibliography"
 msgstr ""
 
+#. Accessible title for a note about a software bug.
+#: yelp-xsl.xml.in:110(msg/msgstr)
+msgid "Bug"
+msgstr ""
+
 #. Revision status of a document or page. Content has been written and
 #. reviewed, and it awaiting a final approval.
 #. 
-#: yelp-xsl.xml.in:108(msg/msgstr)
+#: yelp-xsl.xml.in:118(msg/msgstr)
 msgid "Candidate"
 msgstr ""
 
 #. Default title for a colophon section.
-#: yelp-xsl.xml.in:114(msg/msgstr)
+#: yelp-xsl.xml.in:124(msg/msgstr)
 msgid "Colophon"
 msgstr ""
 
 #. Title of the listing of subsections.
-#: yelp-xsl.xml.in:120(msg/msgstr)
+#: yelp-xsl.xml.in:130(msg/msgstr)
 msgid "Contents"
 msgstr ""
 
 #. Default title for a dedication section.
-#: yelp-xsl.xml.in:125(msg/msgstr)
+#: yelp-xsl.xml.in:135(msg/msgstr)
 msgid "Dedication"
 msgstr ""
 
 #. Revision status of a document or page. Most content has been
 #. written, but revisions are still happening.
 #. 
-#: yelp-xsl.xml.in:133(msg/msgstr)
+#: yelp-xsl.xml.in:143(msg/msgstr)
 msgid "Draft"
 msgstr ""
 
 #. Revision status of a document or page. A senior member of the
 #. documentation team has reviewed and approved.
 #. 
-#: yelp-xsl.xml.in:141(msg/msgstr)
+#: yelp-xsl.xml.in:151(msg/msgstr)
 msgid "Final"
 msgstr ""
 
 #. Automatic heading above a list of related links.
-#: yelp-xsl.xml.in:146(msg/msgstr)
+#: yelp-xsl.xml.in:156(msg/msgstr)
 msgid "Further Reading"
 msgstr ""
 
 #. Default title for a glossary.
-#: yelp-xsl.xml.in:151(msg/msgstr)
+#: yelp-xsl.xml.in:161(msg/msgstr)
 msgid "Glossary"
 msgstr ""
 
+#. Accessible title for an important note.
+#: yelp-xsl.xml.in:166(msg/msgstr)
+msgid "Important"
+msgstr ""
+
 #. Revision status of a document or page. Work has begun, but
 #. not all content has been written.
 #. 
-#: yelp-xsl.xml.in:159(msg/msgstr)
+#: yelp-xsl.xml.in:174(msg/msgstr)
 msgid "Incomplete"
 msgstr ""
 
 #. Default title for an index of terms in a book.
-#: yelp-xsl.xml.in:164(msg/msgstr)
+#: yelp-xsl.xml.in:179(msg/msgstr)
 msgid "Index"
 msgstr ""
 
 #. Automatic heading above a list of guide links.
-#: yelp-xsl.xml.in:169(msg/msgstr)
+#: yelp-xsl.xml.in:184(msg/msgstr)
 msgid "More About"
 msgstr ""
 
 #. Default title for a refnamediv element. This is the common section
 #. title found in most UNIX man pages.
 #. 
-#: yelp-xsl.xml.in:178(msg/msgstr)
+#: yelp-xsl.xml.in:193(msg/msgstr)
 msgid "Name"
 msgstr ""
 
 #. Link text for a link to the next page in a series.
-#: yelp-xsl.xml.in:183(msg/msgstr)
+#: yelp-xsl.xml.in:198(msg/msgstr)
 msgid "Next"
 msgstr ""
 
+#. Accessible title for a note.
+#: yelp-xsl.xml.in:203(msg/msgstr)
+msgid "Note"
+msgstr ""
+
 #. Revision status of a document or page. Content was once current,
 #. but needs to be updated to reflect software updates.
 #. 
-#: yelp-xsl.xml.in:191(msg/msgstr)
+#: yelp-xsl.xml.in:211(msg/msgstr)
 msgid "Outdated"
 msgstr ""
 
 #. Tooltip on play/pause buttons for audio and video objects.
-#: yelp-xsl.xml.in:196(msg/msgstr)
+#: yelp-xsl.xml.in:216(msg/msgstr)
 msgid "Pause"
 msgstr ""
 
 #. Tooltip on play/pause buttons for audio and video objects.
-#: yelp-xsl.xml.in:201(msg/msgstr)
+#: yelp-xsl.xml.in:221(msg/msgstr)
 msgid "Play"
 msgstr ""
 
 #. Default title for a preface to a book.
-#: yelp-xsl.xml.in:207(msg/msgstr)
+#: yelp-xsl.xml.in:227(msg/msgstr)
 msgid "Preface"
 msgstr ""
 
 #. Link text for a link to the previous page in a series.
-#: yelp-xsl.xml.in:212(msg/msgstr)
+#: yelp-xsl.xml.in:232(msg/msgstr)
 msgid "Previous"
 msgstr ""
 
 #. Revision status of a document or page. Content has been written
 #. and should be reviewed by other team members.
 #. 
-#: yelp-xsl.xml.in:220(msg/msgstr)
+#: yelp-xsl.xml.in:240(msg/msgstr)
 msgid "Ready for review"
 msgstr ""
 
 #. Automatic heading above a list of see-also links.
-#: yelp-xsl.xml.in:225(msg/msgstr)
+#: yelp-xsl.xml.in:245(msg/msgstr)
 msgid "See Also"
 msgstr ""
 
@@ -202,30 +222,45 @@ msgstr ""
 #. This is used a tooltip on a link to shrink images back down after
 #. they've been expanded to full size.
 #. 
-#: yelp-xsl.xml.in:234(msg/msgstr)
+#: yelp-xsl.xml.in:254(msg/msgstr)
 msgid "Scale images down"
 msgstr ""
 
+#. Accessible title for a sidebar note.
+#: yelp-xsl.xml.in:259(msg/msgstr)
+msgid "Sidebar"
+msgstr ""
+
 #. Revision status of a document or page. No content has been written yet.
 #. 
-#: yelp-xsl.xml.in:241(msg/msgstr)
+#: yelp-xsl.xml.in:266(msg/msgstr)
 msgid "Stub"
 msgstr ""
 
 #. Default title for a refsynopsisdiv element. This is the common section
 #. title found in most UNIX man pages.
 #. 
-#: yelp-xsl.xml.in:249(msg/msgstr)
+#: yelp-xsl.xml.in:274(msg/msgstr)
 msgid "Synopsis"
 msgstr ""
 
+#. Accessible title for a tip.
+#: yelp-xsl.xml.in:279(msg/msgstr)
+msgid "Tip"
+msgstr ""
+
 #. Figures can automatically scale images down to fit the page width.
 #. This is used a tooltip on a link to expand images to full size.
 #. 
-#: yelp-xsl.xml.in:257(msg/msgstr)
+#: yelp-xsl.xml.in:287(msg/msgstr)
 msgid "View images at normal size"
 msgstr ""
 
+#. Accessible title for a warning.
+#: yelp-xsl.xml.in:292(msg/msgstr)
+msgid "Warning"
+msgstr ""
+
 #. This is an image of the opening quotation character for your language.
 #. The image is used as a watermark on blockquote elements.  There are a
 #. number of different quote characters used by various languages, so the
@@ -246,7 +281,7 @@ msgstr ""
 #. with single quotation marks in your language, use the corresponding
 #. double quotation mark for the watermark image.
 #. 
-#: yelp-xsl.xml.in:284(msg/msgstr)
+#: yelp-xsl.xml.in:319(msg/msgstr)
 msgid "yelp-quote-201C.png"
 msgstr ""
 
@@ -259,7 +294,7 @@ msgstr ""
 #. 
 #. <label/> - The term being defined by the glossary entry
 #. 
-#: yelp-xsl.xml.in:301(msg/msgstr)
+#: yelp-xsl.xml.in:336(msg/msgstr)
 msgid "View the bibliography entry <biblioentry.label/>."
 msgstr ""
 
@@ -281,7 +316,7 @@ msgstr ""
 #. 
 #. <biblioentry.label/> - The text content of the bibliography label
 #. 
-#: yelp-xsl.xml.in:324(msg/msgstr)
+#: yelp-xsl.xml.in:359(msg/msgstr)
 msgid "[<biblioentry.label/>]"
 msgstr ""
 
@@ -297,7 +332,7 @@ msgstr ""
 #. <citation/> - The text content of the citation element, possibly
 #.               as a link to an entry in the bibliography
 #. 
-#: yelp-xsl.xml.in:341(msg/msgstr)
+#: yelp-xsl.xml.in:376(msg/msgstr)
 msgid "[<citation.label/>]"
 msgstr ""
 
@@ -325,7 +360,7 @@ msgstr ""
 #. <comment.name/> - The name of the person making the comment
 #. <comment.date/> - The date the comment was made
 #. 
-#: yelp-xsl.xml.in:370(msg/msgstr)
+#: yelp-xsl.xml.in:405(msg/msgstr)
 msgid "from <comment.name/> on <comment.date/>"
 msgstr ""
 
@@ -352,7 +387,7 @@ msgstr ""
 #. 
 #. <comment.name/> - The name of the person making the comment
 #. 
-#: yelp-xsl.xml.in:398(msg/msgstr)
+#: yelp-xsl.xml.in:433(msg/msgstr)
 msgid "from <comment.name/>"
 msgstr ""
 
@@ -363,7 +398,7 @@ msgstr ""
 #. 
 #. <string/> - The linked-to email address
 #. 
-#: yelp-xsl.xml.in:410(msg/msgstr)
+#: yelp-xsl.xml.in:445(msg/msgstr)
 msgid "Send email to â<string/>â."
 msgstr ""
 
@@ -374,7 +409,7 @@ msgstr ""
 #. 
 #. <glossterm/> - The term being defined by the glossary entry
 #. 
-#: yelp-xsl.xml.in:422(msg/msgstr)
+#: yelp-xsl.xml.in:457(msg/msgstr)
 msgid "Read the definition for â<glossterm/>â."
 msgstr ""
 
@@ -394,7 +429,7 @@ msgstr ""
 #. 
 #. <glosssee/> - The actual link or links of the cross reference
 #. 
-#: yelp-xsl.xml.in:443(msg/msgstr)
+#: yelp-xsl.xml.in:478(msg/msgstr)
 msgid "See <glosssee/>."
 msgstr ""
 
@@ -415,7 +450,7 @@ msgstr ""
 #. 
 #. <glosssee/> - The actual link or links of the cross reference
 #. 
-#: yelp-xsl.xml.in:465(msg/msgstr)
+#: yelp-xsl.xml.in:500(msg/msgstr)
 msgid "See also <glosssee/>."
 msgstr ""
 
diff --git a/xslt/gettext/domains/yelp-xsl.xml.in b/xslt/gettext/domains/yelp-xsl.xml.in
index 7b7ae4a..9c8d421 100644
--- a/xslt/gettext/domains/yelp-xsl.xml.in
+++ b/xslt/gettext/domains/yelp-xsl.xml.in
@@ -95,11 +95,21 @@ to 'qanda', this string will be used to label answers.
 
 <!-- ======================================================================= -->
 
+<msg id="Advanced">
+<its:locNote>Accessible title for an advanced note.</its:locNote>
+<msgstr>Advanced</msgstr>
+</msg>
+
 <msg id="Bibliography">
 <its:locNote>Default title for a bibliography.</its:locNote>
 <msgstr>Bibliography</msgstr>
 </msg>
 
+<msg id="Bug">
+<its:locNote>Accessible title for a note about a software bug.</its:locNote>
+<msgstr>Bug</msgstr>
+</msg>
+
 <msg id="Candidate">
 <its:locNote>
 Revision status of a document or page. Content has been written and
@@ -151,6 +161,11 @@ documentation team has reviewed and approved.
 <msgstr>Glossary</msgstr>
 </msg>
 
+<msg id="Important">
+<its:locNote>Accessible title for an important note.</its:locNote>
+<msgstr>Important</msgstr>
+</msg>
+
 <msg id="Incomplete">
 <its:locNote>
 Revision status of a document or page. Work has begun, but
@@ -183,6 +198,11 @@ title found in most UNIX man pages.
 <msgstr>Next</msgstr>
 </msg>
 
+<msg id="Note">
+<its:locNote>Accessible title for a note.</its:locNote>
+<msgstr>Note</msgstr>
+</msg>
+
 <msg id="Outdated">
 <its:locNote>
 Revision status of a document or page. Content was once current,
@@ -234,6 +254,11 @@ they've been expanded to full size.
 <msgstr>Scale images down</msgstr>
 </msg>
 
+<msg id="Sidebar">
+<its:locNote>Accessible title for a sidebar note.</its:locNote>
+<msgstr>Sidebar</msgstr>
+</msg>
+
 <msg id="Stub">
 <its:locNote>
 Revision status of a document or page. No content has been written yet.
@@ -249,6 +274,11 @@ title found in most UNIX man pages.
 <msgstr>Synopsis</msgstr>
 </msg>
 
+<msg id="Tip">
+<its:locNote>Accessible title for a tip.</its:locNote>
+<msgstr>Tip</msgstr>
+</msg>
+
 <msg id="View images at normal size">
 <its:locNote>
 Figures can automatically scale images down to fit the page width.
@@ -257,6 +287,11 @@ This is used a tooltip on a link to expand images to full size.
 <msgstr>View images at normal size</msgstr>
 </msg>
 
+<msg id="Warning">
+<its:locNote>Accessible title for a warning.</its:locNote>
+<msgstr>Warning</msgstr>
+</msg>
+
 <!-- ======================================================================= -->
 
 <msg id="yelp-quote-201C.png">
diff --git a/xslt/mallard/html/mal2html-block.xsl b/xslt/mallard/html/mal2html-block.xsl
index c7d32b4..173a363 100644
--- a/xslt/mallard/html/mal2html-block.xsl
+++ b/xslt/mallard/html/mal2html-block.xsl
@@ -351,36 +351,44 @@ in accordance with the Mallard specification on fallback block content.
   <xsl:variable name="notestyle">
     <xsl:choose>
       <xsl:when test="contains(concat(' ', @style, ' '), ' advanced ')">
-        <xsl:text>advanced</xsl:text>
+        <xsl:text>Advanced</xsl:text>
       </xsl:when>
       <xsl:when test="contains(concat(' ', @style, ' '), ' bug ')">
-        <xsl:text>bug</xsl:text>
+        <xsl:text>Bug</xsl:text>
       </xsl:when>
       <xsl:when test="contains(concat(' ', @style, ' '), ' important ')">
-        <xsl:text>important</xsl:text>
+        <xsl:text>Important</xsl:text>
       </xsl:when>
       <xsl:when test="contains(concat(' ', @style, ' '), ' sidebar ')">
-        <xsl:text>sidebar</xsl:text>
+        <xsl:text>Sidebar</xsl:text>
       </xsl:when>
       <xsl:when test="contains(concat(' ', @style, ' '), ' tip ')">
-        <xsl:text>tip</xsl:text>
+        <xsl:text>Tip</xsl:text>
       </xsl:when>
       <xsl:when test="contains(concat(' ', @style, ' '), ' warning ')">
-        <xsl:text>warning</xsl:text>
+        <xsl:text>Warning</xsl:text>
       </xsl:when>
+      <xsl:otherwise>
+        <xsl:text>Note</xsl:text>
+      </xsl:otherwise>
     </xsl:choose>
   </xsl:variable>
   <div>
     <xsl:call-template name="html.lang.attrs"/>
     <xsl:attribute name="class">
       <xsl:text>note</xsl:text>
-      <xsl:if test="normalize-space($notestyle) != ''">
-        <xsl:value-of select="concat(' note-', $notestyle)"/>
+      <xsl:if test="$notestyle != 'Note'">
+        <xsl:value-of select="concat(' note-', translate($notestyle, 'ABISTW', 'abistw'))"/>
       </xsl:if>
       <xsl:if test="mal:title and @ui:expanded">
         <xsl:text> ui-expander</xsl:text>
       </xsl:if>
     </xsl:attribute>
+    <xsl:attribute name="title">
+      <xsl:call-template name="l10n.gettext">
+        <xsl:with-param name="msgid" select="$notestyle"/>
+      </xsl:call-template>
+    </xsl:attribute>
     <xsl:call-template name="mal2html.ui.expander.data"/>
     <div class="inner">
       <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>



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