This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: customizing stylesheet with language specific text
- From: Bob Stayton <bobs at caldera dot com>
- To: Marko Petersen <lg002237 at rzserv2 dot fhnon dot de>,docbook-apps at lists dot oasis-open dot org
- Date: Thu, 12 Dec 2002 11:05:52 -0800
- Subject: Re: DOCBOOK-APPS: customizing stylesheet with language specific text
- References: <5.1.1.6.0.20021212191004.00b99a08@rzserv2.fhnon.de>
On Thu, Dec 12, 2002 at 07:40:25PM +0100, Marko Petersen wrote:
> Hi,
>
> I have to add some application specific things to the stylesheet and
> I would like to use the internationalization that is used in docbook. I
> need some language specific files containing the text to embed,
> because I don't want to edit the existing ones so that an upgrade to a
> new style is possible without modifications.
>
> Can anyone tell me how to include this files and how to reference the
> language specific text? I took a look at the different stylesheets but I
> don't understand how these call the language specific text, for example
> for index if no title is set.
If you are using the XSL stylesheets, you can add
localization entries to your customization layer without
touching the distribution files. See:
http://www.sagehill.net/xml/docbookxsl/CustomMethods.html#CustomGentext
Entries like this define general text for each language file:
<l:gentext key="abstract" text="Abstract"/>
The key attribute is the identifier, and the text attribute
is the printable text. To call the text from an XSL
template, you use the gentext template with the key
parameter specified:
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'abstract'"/>
</xsl:call-template>
This will return the value of the text attribute,
which is 'Abstract' in this example.
--
Bob Stayton 400 Encinal Street
Publications Architect Santa Cruz, CA 95060
Technical Publications voice: (831) 427-7796
The SCO Group fax: (831) 429-1887
email: bobs@sco.com