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: Multiple Languages in one DocBook Document


Hi,

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>
 </article>
---------

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
  Zitat</fo:block>

  <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

-- 
Gruß/Regards,
    Thomas Schraitle


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