transfering english themes to arabic/hebrew

eranb2@drupal.co.il - December 14, 2006 - 20:42

Hi

How can I transfer the News Portal to hebrew?

from right to left?

you need to call a different style sheet

mohammed76 - December 14, 2006 - 21:29

hi.

in drupal 4.7.4 a theme was done that supports right to left languages including Arabic and Hebrew. that theme was called bidi. not sure about drupal 5.

however it should be easy to do if you follow the following steps to customize any php template based theme.

  1. copy your style.css file and rename it to become: style-rtl.css so that you have both style.css and style-rtl.css in your theme directory.
  2. put the following at the beginning of your new style-rtl.css file:
    /* rtl */
    body {
      direction: rtl;
       text-align: right;
    }
  3. in your template.php file add the following function:
    function phptemplate_stylesheet_import($stylesheet, $media = 'all') {
      $rtl = in_array(locale_initialize(), array('ar', 'fa', 'he', 'ur'));
      if (!$rtl) {
        return theme_stylesheet_import($stylesheet, $media);
      }
      if ($stylesheet == base_path() . 'misc/drupal.css') {
        $stylesheet = 'misc/drupal-rtl.css';
      }
      if ($stylesheet == base_path() . path_to_theme() . '/style.css') {
        $stylesheet = base_path() . path_to_theme() . '/style-rtl.css';
      }
      return theme_stylesheet_import($stylesheet, $media);
    }

Hope this helps

NICE!

marafa - December 14, 2006 - 22:34

this is nice! i have been wondering how to do this for a bit!

i m trying it out right now but the theme i m using (fancy) doesnt have a template.php.

i know some of the other do have the file but not this theme. whats the recommended action?

thanks

create one

mohammed76 - December 15, 2006 - 08:34

hi.

in such a case you just create a file called template.php with the mentioned function in it. make sure you start the file with the proper php <?php and close it with ?> and put it inside of your theme directory. in your case put it in themes/fancy

Mohammed al-shar'

Nattiq Technologies

HI Thanks for replying. I

eranb22 - December 15, 2006 - 16:01

HI

Thanks for replying.

I tried the changes on the "news portal" and there was no difference .

If I just change the text-align:left to right it help in some way.

Eran

Drupal 5.1

alshamiry - March 14, 2007 - 11:39

I am using Drupal %.1 to create a magazine in Arabic, and every time i apply the RTL to the template the bullet points go all over the place, i was wondering if anyone could help?

THankz

in 5.1 it's a different story

mohammed76 - March 16, 2007 - 09:47

hi.

in drupal 5.x the above mentioned function won't work. you need to play abit with your page.tpl.php file to achieve the result you're asking for. could you post back and tell us more details? what theme are you trying to customise, do you need bidi functionality or is it going to be arabic only? etc.

Mohammed al-shar'

Nattiq Technologies

customizing a theme for rtl arabic text

nasheet - March 18, 2007 - 12:49

I am using drupal 5.1 and have a site that's main language is in english, but has translations to arabic and french. I am using the localizer module to switch languages and using the theme, aberdeen, which I am reluctant to change since I like the look and have spent a long time tweaking the css to make it look good.

My problem is that all the arabic in the posts are written left to right, with the periods at the beginning of the sentence. I inserted a HTML code to correct it, but I am looking for a nicer, and easier, way to do this since there will be other users updating the website that don't know HTML coding. I hope I can do it without changing the theme.

Since it is a multilingual site and is set up on drupal 5.1, I can't find any fix to this problem in the forums. Do you have any suggestions?

drupal 5.x changing any 3-col theme to rtl

cestmoi - March 24, 2007 - 12:23

Hi nattiq

Thanks for mentioning that the above function won't work with 5.x because I'd been knocking my head of my PC trying to make it work.

I am trying to rtl "any" theme to work with drupal 5.x . The bidi theme doesn't function (no rtl at all) as it seems to be still not upgraded. The garlandrtl is still buggy in IE.

I was trying to rtl the garland theme as I like it and I need a three-column theme. I would really appreciate your help if possible. I am not fussy about the theme as long as it is three-column so if you think it'd be easier to start with another theme that's fine. Also although I prefer having a bidirectional functionality, if this is a hassle it's fine to have just the rtl then.

thanks

by the way, your site looks so good (are you runing 5.x ??)

yes it is

mohammed76 - March 26, 2007 - 17:41

hi.

yes my site is running 5.1

actually the garlandrtl theme appears to be a little buggy in internet explorer. lets have a chat on your choice of messangers to try to help with some other theme. drop me a message using my contact form.

Mohammed al-shar'

Nattiq Technologies

correction of arabic using HTML

happyonlinelb - May 21, 2007 - 12:56

Hello,

I'm running Drupal 5.1, using it for a static webpage. Someone in the forum mentioned that he was able to change the alignment and text properly using HTML code.

Can you please specify what exactly you have done to correct RTL and points.

Thank you

 
 

Drupal is a registered trademark of Dries Buytaert.