View Source

<p>If the language that you are translating to is writen from right to left, maybe you will face some problems with DocBook and the words won't appear in the right way.<br />
I met this problem too when I was translating to Arabic, but I did some steps which helped in solving the problem and I hope that this steps will help you too.</p>
<ac:macro ac:name="note"><ac:parameter ac:name="title">PS</ac:parameter><ac:rich-text-body>
<p> All the following steps will take place in your language's directory on SVN<br />
f.e. \svn\trunk\documentation\manual\ar (the Arabic Language dir)
<br class="atl-forced-newline" /></p>

<p> <strong>after <a href="http://framework.zend.com/wiki/display/ZFDEV/Zend+Framework+Translator+-+Manual+Compilation+Instructions">compiling</a> your manual, a new folder called &quot;docbook-xsl&quot; will be added to the &quot;build&quot; folder.</strong></p>
</ac:rich-text-body></ac:macro>

<h1>Table of Contents</h1>

<ac:macro ac:name="toc-zone"><ac:parameter ac:name="location">top</ac:parameter><ac:parameter ac:name="type">list</ac:parameter><ac:parameter ac:name="style">none</ac:parameter><ac:parameter ac:name="outline">false</ac:parameter><ac:parameter ac:name="indent">20px</ac:parameter><ac:parameter ac:name="printable">true</ac:parameter><ac:rich-text-body>



<p><br class="atl-forced-newline" /></p>

<h3>Changing the direction of the contents in the page to be RTL</h3>

<ol>
<li>open &quot;\build\docbook-xsl\html\docbook.xsl&quot;</li>
<li>after the line #116 which contains
<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
'<xsl:attribute name="alink">#0000FF</xsl:attribute>'
]]></ac:plain-text-body></ac:macro>
add this line
<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
'<xsl:attribute name="dir">rtl</xsl:attribute>'
]]></ac:plain-text-body></ac:macro></li>
</ol>


<p><br class="atl-forced-newline" /></p>
<hr />
<p><br class="atl-forced-newline" /></p>

<h3>Reseting the direction of the '<code>&lt;pre&gt;</code>' tag to be LTR</h3>

<ol>
<li>open &quot;\build\docbook-xsl\html\verbatim.xsl&quot;</li>
<li>on the lines #51, 58, 91 and 111<br />
replace
<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[ '<pre class="{name(.)}">' ]]></ac:plain-text-body></ac:macro>
with
<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[ '<pre class="{name(.)}" dir="ltr" >' ]]></ac:plain-text-body></ac:macro></li>
</ol>


<p><br class="atl-forced-newline" /></p>
<hr />
<p><br class="atl-forced-newline" /></p>

<h3>Aligning the contents to right:</h3>

<ol>
<li>open &quot;\html\dbstyle.css&quot;</li>
<li>add this at the end of the file.
<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[ p { text-align: right;} ]]></ac:plain-text-body></ac:macro></li>
</ol>


<p><br class="atl-forced-newline" /></p>
<hr />
<p><br class="atl-forced-newline" /></p>


<h3>Translating the generated static words in the docs</h3>
<p>what I mean is replacing the words like &quot;Next, index, chapter ..etc&quot; with its<br />
equal words in the language that's you are translating to.</p>

<ac:macro ac:name="note"><ac:parameter ac:name="title">Is my language supported?</ac:parameter><ac:rich-text-body>
<p>check &quot;\build\docbook-xsl\common\&quot; for list of supported translations.</p></ac:rich-text-body></ac:macro>

<ol>
<li>open &quot;\manual.xml&quot;</li>
<li>on line #8 change the value of the attribute &quot;lang&quot; of the tag &quot;book&quot; from &quot;en&quot; to the acronym of the language that you are translating to.<br />
f.e. if you are translating to Arabic(ar), it will be
<ac:macro ac:name="code"><ac:plain-text-body><![CDATA['<book id="manual" lang="ar">']]></ac:plain-text-body></ac:macro></li>
<li>replace the contents of the tags &quot;title&quot; and &quot;edition&quot; with the content's translation.</li>
</ol>


<p><br class="atl-forced-newline" /></p>
<hr />
<p><br class="atl-forced-newline" /></p>

<h3>Fixing the problem of the embeded english words in the content</h3>

<p>The problem: when you set the direction of the contents to be RTL and there is english words embeded in the content formated like &quot;<code>$name</code>&quot; and &quot;<code>Zend::dump()</code>&quot;.<br />
this words will appear in the generated Docs in that way ( &quot;<code>name$</code>&quot; and &quot;<code>()Zend::dump</code>&quot;.
<br class="atl-forced-newline" />
The solution: when translating write this words in that way ( &quot;<code>name$</code>&quot; and &quot;<code>()Zend::dump</code>&quot; ) so when it's displayed in the Docs, it will appear in the right way.</p>
</ac:rich-text-body></ac:macro>