Directionality functions & integrating RTL CSS files in core modules

Events happening in the community are now at Drupal community events on www.drupal.org.
z.stolar's picture

This is an old issue, and I wish to get a clear up-to-date status of the situation in Drupal 6 (or 5). It may have been answered already, so a redirection would be as good as an answer :-)

  1. RTL CSS files in core: In order to ease the RTLization of themes, and to set a nice example for themers and module developers, core modules should come with and RTL version of CSS. Such a set already exists, and is used in every hebrew Drupal site, and surely in other RTL languages sites as well.
    To understand the real need for that, you must try to create a Drupal site in two languages: one LTR and the other RTL. It's a real pain. Currently we include a file (attached here), which overrides the default $css array in themes, and chooses the RTLized version. If this went into core, it would save us lots of work and bugs, as well as prepare the ground for other directionality operations.
  2. Identifying the right direction: We know that the i18n package contains a way to define directionality of languages, and use it in themes, but here is the dilemma: Must every non-english site use i18n? That is: if my site is uni-lingual, let's say herbrew or chinese or russian, do I still have to use the i18n package to benefit from the goods of it? That is more relevant to RTL languages of course, than for LTR languages, but is still a critical issue.

The Israeli community is busy with these questions now, and it could be nice to get a nice clear view of the situation in both Drupal 5 and 6.

Thanks!

AttachmentSize
load_rtl_core_css.php_.txt807 bytes

Comments

Drupal 6 knows about RTL languages!

gábor hojtsy's picture

Drupal 6 has built in knowledge about RTL languages. Drupal 6 themes get a $language object, which has information about the direction of the current language used. This is provided for one language sites as well as twelve language sites (and in-between :).

Drupal 6 does not come with a set of RTL CSS files though, which I think would be a very nice addition. I have not seen a core patch that included RTL CSS files, and a way to use them when the $language of the page is RTL. I wold welcome it though, and help you get it into Drupal 6.

In fact I posted a note to the Arabization group a month ago as a call to arms about testing Drupal 6 RTL support and adding RTL CSS. There were no replies unfortunately.

Patches are on their way

z.stolar's picture

We prepare the needed patches, and will shortly upload them as an issue against core.

The first patch modifies drupal_add_css() to select an RTLized version of a any requested CSS file (you call system.css, you get system-rtl.css).

The second one is about adding the RTLized CSS files into core, and here I need an advice: how to create a patch that adds a file into many directories - one CSS for each relevant core module (not all core modules have styles that affect directionality)?

adding/deleting files

gábor hojtsy's picture

Read adding/deleting files at http://drupal.org/patch/create (also post the link to the issue here when ready, so you have some spotlight for it).

New patch available

yhager's picture

Sorry, I wasn't aware of the 'Adding/deleting files' link you sent, so I prepared a new patch using plain old 'diff'.

Please let me know if the patch works for you, or if I have to recreate it.

Thanks!

Internationalization

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: