Texts such as Arabic, Farsi (Persian), Urdu and Hebrew are written from right to left. Possible in previous release via hooks in the plugin, xili-language plugin (since 0.9.9) provides now functions and vars to display right to left languages. These can be used by designer of theme to create multilingual sites.
The current theme of de.xiligroup here is under renovation and step by step, menus will integrate rtl writting as this Welcome post in « google » arabic. Don’t hesitate to comment.
Some examples in theme files and style.css :
Here, the current theme language is used in a div box :
<?php $themelangdir = ((class_exists('xili_language')) ? the_cur_lang_dir() : array ()) ; ?> <div class="inside <?php echo $themelangdir['direction'] ?>"> ... |
Here, in the loop, the language of the post is used in the ‘div.store’ html tag :
<?php while (have_posts()) : the_post(); $langdir = ((class_exists('xili_language')) ? get_cur_post_lang_dir($post->ID) : array()); ?> <div class="story <?php echo $langdir['direction'] ?>" > |
Minimal examples in css
.rtl {direction: rtl; text-align:right !important; font-size:130% !important;} .ltr {direction: ltr; text-align:left !important;} |
Caution : multilingual theme with both ltr and rtl texts in the same page needs a rigourous structure of the css !
A future post will gather together tips, tricks and hints about this specific feature ltr or rtl direction design.
M 090426