In order to support languages that read right to left some changes must be made. I have already committed a RTL image and stylesheet. There is also a bug that causes node counts to malfunction when using a RTL language which needs a fix.

Image and stylesheet added and committed to 6.x-2.x-dev and 5.x-2.x-dev.

Comments

xano’s picture

Pagers are RTL now too. Still looking for a solution for RTL support in Drupal 5. Perhaps using i18n?

good_man’s picture

Hey,

First of all some facts about RTL and how browsers render them:

when writing from right to left (RTL), you must use (direction:rtl;) in body or html class in your style file, like in Garland theme (style-rtl.css). Also, if you wrote Arabic words (Arabic is RTL) and you used parentheses, the parentheses will appear in the opposite order. for example shift+9 gives you the opening parenthesis ( ,but when writing in RTL it gives you the closing one ) . and vice versa.

This is a problem, because when you write English word and you used parentheses in RTL, they will appear as LTR but in RTL. yeah, it's hard to understand but I'll explain:

for example I'm using RTL now in my web site and I wanted to show this: a (1). if I write this in my web site it'll not look okay except if I changed it to LTR from CSS, Look at this to understand it better:
http://drupal.holooli.com/?q=dictionary

the first three terms are English letters, the second set are Arabic. I turned node count on, so what happens. English letters and the parentheses for node count don't appear in the right order. try changing the direction using firebug to LTR and they'll look okay. the second set appear well, because it's an Arabic letter followed be the parentheses (remember in RTL the opening parenthesis is the closing one in LTR and vice versa).

so what should we do. the best solution is either don't write English terms in Taxonomy and this is very bad, because sometimes you have to include English terms in your RTL site, or we should change parentheses in node count to something else.

xano’s picture

I think I got it. There was one thing I found very strange when looking at a simple Drupal site using Garland and using a language set to RTL: periods and other punctuation were moved to the beginning of each line. If you are using an actual RTL language this is OK, but in my test case I was using English, which made it look like some kind of bug. After some testing I realised only the last set of punctuation characters of a sentence would be put at the beginning of the line it was on. Since browsers obviously see parentheses as punctuation closing parentheses are being changed position when using node counts.

So our new question is how we prevent this from happening.

I tried to put a <span> with dir="rtl" around the node count like this:

$nodes = ' <span dir="rtl">(' . $node_count . ')</span>';

This code worked perfectly and made sure that whatever the term names were, the node count parentheses stayed intact. However, what about term names that contain both Western characters _and_ punctuation?

good_man’s picture

all right, inline style do it ,but CSS can not.

except an extreme case like: H (letter)
http://drupal.holooli.com/?q=dictionary

xano’s picture

That's what I meant. There is a problem as soon as term names contain punctuation.I'm still trying to figure out a way to solve this.

xano’s picture

Status: Needs work » Needs review

I used the following code to make sure node counts are displayed correctly:

$nodes = ' <span dir="' . $dir . '">(' . $node_count . ')</span>';

$dir is a variable passed on to the theme function that contains either 'rtl' or 'ltr' depending on the text direction of the currently used language.

There is no patch, but the code does need review. Please test it by using the latest 6.x-2.x-dev.

good_man’s picture

Good, and there is no way to prevent the English terms with punctuation.

xano’s picture

Could you do some more tests to make sure Vocabulary Index works on RTL sites?

good_man’s picture

I did some tests on localhost and it works well ... what do you want exactly?

xano’s picture

I want it to work with RTL sites as good as it works with LTR sites. As far as I can see it does, but I only use LTR languages. You use RTL more than I do, so perhaps you can test it better too.

xano’s picture

I have removed the RTL CSS file. It wat only necessary for the background images, but they are no longer being used.

good_man’s picture

so now it's working without it?

sorry for being late, but the site I was working on is postponed!

xano’s picture

There are now still some RTL-measures, but none related to CSS since those measures were only applied to lists with custom list-style-images, which aren't being used anymore.

//Edit: Could you please test some more using a test site?

good_man’s picture

I'll try, but give me some days ;)

good_man’s picture

I use the newest development version nov/5, and it's working great ... thanks for your efforts and excuse me

xano’s picture

Status: Needs review » Fixed

That's good to hear. Thank you very much for testing!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

xano’s picture

Assigned: xano » Unassigned