Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#377 fo: Localized output of @function in keycap not supported

output: all formats
open
nobody
XSL (399)
5
2007-07-30
2007-03-14
Thomas Schraitle
No

Hi,

as suggested in [1], the function attribute in keycap is not supported.

For example, if you write <keycap function="control"/> I thought that the
stylesheets fill in the missing content with a localized version. Unfortunatly, there is no output.

I think, an empty <keycap/> tag might be useful for translation issues to descrease costs and improve consistency.

For this reason I suggest to modify two things:

1. Extend the localisation files under common/ with a kontext "keycap". Inside the context you find all the necessary translation. For example, some entries in German could look like this:

<l:context name="keycap">
<l:template name="alt" text="Alt"/>
<l:template name="backspace" text="&lt;&#x2014;"/>
<!-- <l:template name="command" text=""/> -->
<l:template name="control" text="Strg"/>
<l:template name="delete" text="Entf"/>
<!-- ... -->
</l:context>

2. Modify the template keycap in fo/inline.xsl and {html,xhtml}/inline.xsl to support localized keycaps:

<xsl:template match="keycap">
<xsl:param name="key.contents" select="."/>
<xsl:variable name="key.length" select="string-length($key.contents)"/>

<xsl:choose>
<xsl:when test="@function and @function!=''">
<xsl:call-template name="inline.boldseq">
<xsl:with-param name="content">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="local-name()"/>
<xsl:with-param name="name" select="@function"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="inline.boldseq"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

Hope it helps.
Tom

---------
[1] http://lists.oasis-open.org/archives/docbook-apps/200703/msg00026.html

Discussion

    • labels: 321159 --> XSL
    • milestone: 447636 --> output: all formats
    • summary: Localized output of @function in keycap not supported --> fo: Localized output of @function in keycap not supported
     
  • Logged In: YES
    user_id=118135
    Originator: NO

    Not a bug.

     
  • Logged In: YES
    user_id=27667
    Originator: YES

    Of course, it's not a bug, it's a suggestion. :) I suggested the method on the docbook-apps mailinglist some time ago, but nobody responded, so I thought I make a feature request.
    Please consider this change. :-)