When installing the module, if the selected language is not RTL, no style is being loaded.

As a workaround, enable the locale module, and install an RTL (e.g. Hebrew) language, and select it.

Comments

gilf’s picture

As a workaround, enable the locale module, and install an RTL (e.g. Hebrew) language, and select it.

Does not work for me. looking at the page source in English (EN) no styles appear. In Hebrew (HE) I get the correct *-ltr.css styles.
I am using the localization (http://drupal.org/project/i18n) module. Echoing the $language var to the screen shows the correct language.

I am note a coder, but something seems to be missing from the ELSE statment in line 132 of template.php.
I added the following block :

    foreach($css as $media => $types){
      foreach($types as $type => $files){
        foreach($files as $file => $preprocess){
          $element = $file;
          // Try to locate the RTL  style in the theme's directory. If not found, try to find it in the same directory as the original file.
          $rtl_style = $directory . '/css/' . str_replace(".css","-ltr.css",basename($file));
          if (!file_exists ($rtl_style)) {
            $rtl_style = dirname ($file) . '/' . str_replace('.css','-ltr.css',basename($file));
          }
          if(file_exists($rtl_style)){
            unset($css[$media][$type][$file]);
            // tell drupal_get_css to preprocess it
            $css[$media][$type][$rtl_style] = $preprocess;
          }
        }
      }
    }
    print drupal_get_css($css);

Which is almost a verbatim copy of the previous statement.
I now get a style sheet, but overall orientation is still RTL