[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: DOCBOOK-APPS: How to customize localized text within theXSL-Stylesheets?
> From: Ali Saffari <firstname.lastname@example.org> > > I was wondering if there is a nice way to change some of the > entries in the localized text messages defined in the common > directory. > > For example I want to change the entry=20 > > <gentext key=3D"nav-next" text=3D"Vor"/> > > to=20 > > <gentext key=3D"nav-next" text=3D"Nächste Seite"/> > > in the de.xml file. But on the head of each xml file > you can see this message > > <!-- This file is generated automatically. --> > <!-- Do not edit this file by hand! --> > <!-- See http://docbook.sourceforge.net/ --> > > Actually I don't want to change every entry in the file > only a few of them. The new entries should overwrite the > old ones defined in the standard files. Is there any good way=20 > to this customization and beeing updateable through next=20 > releases of the stylesheets? Yes, there is. Norm has provided a customization feature to that. Put something like this in your XSL customization file: <xsl:param name="local.l10n.xml" select="document('')"/> <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0";> <l:l10n language="de"> <l:gentext key="nav-next" text="Nächste Seite"/> <!-- other customizations here --> </l:l10n> </l:i18n> Note that the language files now use the l: namespace. The trick here is the select="document('') attribute. This special syntax reads the current document (the stylesheet file) into the 'local.l10n.xml' variable. When the stylesheet goes to generate text, the stylesheet first scans that variable for a match before going to the standard language files. The use of the namespace prevents accidentally picking up any literal result elements that might be lurking in the stylesheet (unlikely, but possible). bobs Bob Stayton 400 Encinal Street Publications Architect Santa Cruz, CA 95060 Technical Publications voice: (831) 427-7796 Caldera International, Inc. fax: (831) 429-1887 email: email@example.com
Powered by eList eXpress LLC