OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] Multiple Languages in one DocBook Document

Hi Thomas,
While there is code in the HTML stylesheets to handle @lang down the element level, no such code was ever added to the fo stylesheets. The lang attribute and writing-mode are only used at the document level in fo.

At this point I would consider this to be a bug, so please go ahead and file a bug report on the DocBook SourceForge site. I don't see an easy fix for it, though, because a lot of templates for elements will have to be modified.

Bob Stayton
Sagehill Enterprises

On 10/14/2014 5:11 AM, Thomas Schraitle wrote:

ok, lets assume, we have an article. Its main language is in English.
Furthermore, our document needs some paragraphs in a different language.
The natural way would be to use the lang attribute like in the
following excerpt (DocBook 4.5):

  <article lang="en">
     <title>Language Test</title>
     <para lang="de">Dies ist ein deutscher Absatz.</para>
     <para lang="ar">هذه هي الفقرة العربية.</para>

Transforming* the above document into XSL-FO leads to the following
fo:block structures:

   <fo:block space-before.optimum="1em" space-before.minimum="0.8em"
         space-before.maximum="1.2em">Dies ist ein deutsches

   <fo:block space-before.optimum="1em" space-before.minimum="0.8em"
         space-before.maximum="1.2em"> هذه هي الفقرة العربية.</fo:block>

I would have expected to see a language attribute (and perhaps a
writing-mode as well). Unfortunately, it's not there. As such, in the
German and Arabic paragraph English hyphenation rules are applied. This
is obviously not correct. :)

I tried a sect1 element with a lang attribute with the same result.

Looking into the FO stylesheets, I identified some spots which I would
consider it as "fishy":

1. fo/param.xsl, parameter writing.mode
    Its default value is taken from the language file by using the
    gentext template.
    However, the lang argument is set to "/*[1]" which is valid for a
    document with one main language. Unfortunately, this value does not
    help when using multiple languages.

2. fo/block.xsl, template match="para"
    The para template does not contain any code which would add the
    missing language or writing-mode attributes.

I tried it also with the latest snapshot release (28-Sep-2014 17:02,
r9945) but the results are the same.

Could someone confirm or extend my analysis? Does someone know what goes
wrong here? :)

* Used 1.78.1 of the DocBook XSL stylesheets
   libxml2: 2.9.1
   libxslt: 1.1.28

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]