Movable Type and RTL languages

I’m work­ing
on an inter­na­tion­al site built in Mov­able Type and includ­ing statements
in mul­ti­ple lan­guages, includ­ing “Right to Left” lan­guages like Arabic
and Hebrew. 

I was pleas­ant­ly sur­prised when I cut-and-pasted an Ara­bic text from
MS Word into Mov­able Type and found the let­ters look­ing good both in
the MT entry box and the resul­tant post. I did­n’t real­ize just how pow­er­ful UTF-8 encod­ing
is and how well MT sup­ports it through­out the sys­tem. Still, the output
was­n’t cor­rect, as it was­n’t dis­played in right-to-left fash­ion. I
need­ed to fig­ure out the CSS for this kind of out­put and an easy way to allow the client to set this with­out forc­ing them into coding.

Using the highly-recommended Right­fields Plu­g­in I added a check­box field for posts that should be dis­played in RTL. Here’s a screenshot:

Right­Fields has an IF func­tion that we can use to set a new DIV with our RTL style. Here’s the cod­ing in the MT tem­plate, stuck in just after the “entry-body” div:

<MTExtraFields>
<MTIfExtraField field="RTL">
<div class="rtl-display">
</MTIfExtraField>

Note: you’ll also have to add sim­i­lar code to close the div at the end of the passage.

Final­ly, as best as I can deter­mine, this is the prop­er CSS des­ig­na­tion for RTF dis­play (Microsoft has a good web­page on this). It works in Fire­fox, IE7 and IE6.

.rtl-display p {direction:rtl;text-align:justified;text-align:justify;}

I’d be hap­py to get any feed­back or cor­rec­tions to this. I’m a typ­i­cal ‘Mer­i­can
whose for­eign lan­guage skills don’t go far past a dozen phras­es lifted
from Sesame Street and long-ago French class­es. Ara­bic and Hebrew
type­set­ting are quite unfa­mil­iar terrain.

Posted May 7th, 2007 , in Uncategorized. Tagged ,

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Comments on Quaker Ranter Daily