This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] Changing values of language.xml


Kai Hagemeister wrote:

I'm trying to change some values of language output. Index for example
should still be index and not be changed to my local language.

I found out that in docbook the template gentext in common/l10n.xsl is
called which calls l10n.xml. In l10n.xml is a list of entities which
points to the xml language-file.
How can i override a special term like index in this language-file?

There's a hook in common/l10n.xsl which allows customization: A parameter called "local.l10n.xml" allows to modify (or add) gentext entries without copying too much stuff.

In your have a customization layer, add into one of your XSL files:

1) ...the internationalization namespace as an attribute
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0";
                ...
>

2) A parameter which points local.l10n.xml this very stylesheet
<xsl:param name="local.l10n.xml" select="document('')" />

3) A l:i18n element containing just the *changes* (or additions):
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0";>
  <l:l10n language="de">
   <l:gentext key="Index" text="Index"/>
   <l:gentext key="index" text="Index"/>
   <l:gentext key="setindex" text="Index"/>
   <l:gentext key="SetIndex" text="Index"/>
  </l:l10n>
</l:i18n>

I tried to copy the template gentext in a xsl-file of my local directory
where all my stylesheets are lying which override the docbookstylesheets.
Then i did also copy l10n.xml and the language xml-file. I changed the
term of index to index and Index to Index but it didn't work. It's still
calling the xml-file from the docbook-directory.

l10.xml is included in common/l10n.xsl via a parameter as <xsl:param name="l10n.xml" select="document('../common/l10n.xml')"/> If you change the value of the l10n.xml parameter in your layer to point to your copies, I don't see why your method shouldn't work as well... -- HTH, haj




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]