Why RTL works on 6.x.1.1 without even having RTL style sheet?

Comments

johnalbin’s picture

Status: Active » Postponed (maintainer needs more info)

I don't understand the question. You'll need to explain what you did, what you expected, and what you experienced.

lameei’s picture

Status: Postponed (maintainer needs more info) » Active

As you may know in an RTLized theme we expect the direction of the content to be RTL, So when you create content at the content creation page the text have the RTL direction. In Drupal this happens by calling the style-rtl.css file if you enable an RTL language. So there is a function in template.php which checks the language of the website and decides if there is a need for calling the style-rtl.css file. Zen does not have such a mechanism, So we should not be able to create an RTL content , But we CAN. if you enable an RTL language at the content creation page the text aligned right and Also has the RTL direction.
I digged the code using firebug but i got no clue of the way it happens. I'm looking for the reason of this.

johnalbin’s picture

Title: RTL works on 6.x.1.1 » How does RTL work?
Category: bug » support
Status: Active » Fixed

In Drupal this happens by calling the style-rtl.css file if you enable an RTL language. So there is a function in template.php which checks the language of the website and decides if there is a need for calling the style-rtl.css file. Zen does not have such a mechanism,

You've misunderstand the mechanism slightly. Drupal uses drupal_get_css() to add a theme's stylesheets to the <head> of the page. And, if the current language is RTL, that function will, for each stylesheet, look for a correspondingly-named -rtl stylesheet and load it too.

So, no themes need to handle loading the RTL stylesheets; they just need to have -rtl stylesheets.

lameei’s picture

Status: Fixed » Active

Thanks for correcting me. But there is no RTL style sheet in my zen sub theme and it acts correctly with RTL langs. how does this possible?

portulaca’s picture

Check your page source, it loads rtl sheets from the modules dirs, doesn't it?

lameei’s picture

Status: Active » Fixed

Many thanks for the complete description. It helped me much.

Status: Fixed » Closed (fixed)

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