Bug 475077 - fix rtl problems in docbook-xsl
fix rtl problems in docbook-xsl
Product: Fedora
Classification: Fedora
Component: docbook-style-xsl (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Ondrej Vasik
Fedora Extras Quality Assurance
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2008-12-07 09:28 EST by Muayyad Alsadi
Modified: 2009-02-02 10:13 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-02-02 09:39:57 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Muayyad Alsadi 2008-12-07 09:28:26 EST
Description of problem:
some languages like Arabic are written from right to left

this mean that alignment should be mirrored for those languages

I made a patch to fix this

first apply the attached patch with -p1

then run this script

for i in html xhtml
perl -i -wpe 's/align="left"/align="{\$directions.align.start}"/g' ${i}/*
perl -i -wpe 's/align="right"/align="{\$directions.align.end}"/g' ${i}/*

Additional info:
up stream report
Comment 1 Ondrej Vasik 2008-12-07 17:12:45 EST
Thanks for info and patch, I would like to have it accepted by upstream before adding to Fedora. Additionally there was some perl script cleanup in docbook-* packages to reduce perl build requires, so I would use sed for that if you don't mind - once the proposed patch will be accepted by upstream.
Comment 2 Ondrej Vasik 2009-01-29 09:40:13 EST
Not only html/xhtml, fo branch has to be fixed as well ... anyway - fix was accepted by upstream and included to latest svn snapshot(although in a bit different way). I tried to backport it to 1.74.0, result built in rawhide as docbook-style-xsl-1.74.0-5.fc11 , please give it a try and let me know if it does work for you. Closing RAWHIDE.
Comment 3 Muayyad Alsadi 2009-01-29 12:13:40 EST
sure, I'll try it

but the upstream did not set the default encoding to UTF-8

and setting it to UTF-8 with params works only for chunks (not single or main file)
Comment 4 Muayyad Alsadi 2009-01-30 20:06:46 EST
it did not work
I tried
xsltproc /usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl ghelp/ar/RELEASE-NOTES.xml > RELEASE-NOTES-ar.html

after installing the packages
then grep dir= RELEASE-NOTES-ar.html 

if you want to try it yourself just have a document that starts like this
<article id="article" lang="ar_JO">

note: the upstream snapshot works
Comment 5 Ondrej Vasik 2009-02-02 06:05:28 EST
This seems to work for me:
xsltproc --stringparam writing.mode "rl" /usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl arabic.xml >arabic.html

It seems that most of the patch is working, but the language setting from common/ar.xml is ignored (just l10n.xml is called according to xsltproc verbose log)... Will try to check more, please use that stringparam workaround meanwhile.
Comment 6 Muayyad Alsadi 2009-02-02 09:12:58 EST
you should not pass --stringparam writing.mode "rl"

it should be autodetected with gettext

and while looking into the patch you missed the following lines in html/param.xsl
<xsl:param name="writing.mode">
  <xsl:call-template name="gentext">
    <xsl:with-param name="key">writing-mode</xsl:with-param>
    <xsl:with-param name="lang">
      <xsl:call-template name="l10n.language">
        <xsl:with-param name="target" select="/*[1]"/>
Comment 7 Ondrej Vasik 2009-02-02 09:39:57 EST
Yep, I knew it should be autodetected, I just said it could be used as temporary workaround. 

Thanks for the fix for my patch, I simply missed that when backporting upstream fix to 1.74.0. It seems to work now correctly for my test arabic xml file, built as docbook-style-xsl-1.74.0-6.fc11 . Closing RAWHIDE again.
Comment 8 Muayyad Alsadi 2009-02-02 10:13:23 EST
thank you very much
it works for me

Note You need to log in before you can comment on or make changes to this bug.