Linux Archive

Linux Archive (
-   Fedora Development (
-   -   better internationalization in docbook-style-xsl (

"Muayyad AlSadi" 11-27-2008 09:41 PM

better internationalization in docbook-style-xsl
I made some patches into docbook-style-xsl-1.74.0-3.fc10.noarch
to make it better for international environment

before you ask me why in devel ML why not doc-ML why not upstream ?
I say because I want to make it better
so that when we upstream it we won't find any issue

for example the file html/docbook.xsl have a header like this
<xsl:output method="html"

while the xhtml/docbook.xsl uses utf-8

changing the first one to be just like the second ie. utf-8 encoding
won't drop any feature but it will produce better files
(if a non-ASCII non-Latin-1 is used with ISO-8859-1 encoding it will
be encoded like this &xxxx; for each char)

second thing,
left and right are not what we want, we want here and there
(in right to left languages left and right are mirrored)
in the ODF standard they call it start and end (start is the same
direction as the current script ie. left for English and right for

I patched the xsl with a script (to make sure they are all fixed
because a diff patch will be broken if the upstream make any change)

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}/*

this way all the align="left" will be substituted with the value of
the param directions.align.start ..etc.

we need to declare this param somewhere depending on the locale
so I edited html/param.xml to have something like

<xsl:param name="directions.align.start">
<xsl:when test="$direction='rtl'">right</xsl:when>

<xsl:param name="directions.align.end">
<xsl:when test="$direction='rtl'">left</xsl:when>

which mean if I cant to make a RTL right-to-left document a set a
param called direction to the value rtl
other wise left to right direction will be assumed

I need a better automated way for doing this
I want the direction to be guessed from the language of the document
if it's in the list of right-to-left languages (Arabic, Parisian,
Urdu, Hebrew, ..etc.)
ie. when there
<article id="my_article" lang="ar_JO"> or <book id="my_book" lang="ar_JO">
direction param should be set to rtl

how can I do this last step instead of passing --stringparam direction
rtl to xsltproc

fedora-devel-list mailing list

All times are GMT. The time now is 06:23 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.