From 2d2236accf26a5c1cf02eac93f1b1d61a3cb6c8c Sun, 15 Jan 2012 22:06:14 +0100
From: Bram Goffings <bramgoffings@gmail.com>
Date: Sun, 15 Jan 2012 22:06:06 +0100
Subject: [PATCH] language




diff --git a/core/modules/language/language.module b/core/modules/language/language.module
index b36fc78..44d5917 100644
--- a/core/modules/language/language.module
+++ b/core/modules/language/language.module
@@ -198,3 +198,30 @@
   }
   return FALSE;
 }
+
+/**
+ * Implements hook_css_alter().
+ *
+ * This function checks all CSS files currently added via drupal_add_css() and
+ * and checks to see if a related right to left CSS file should be included.
+ */
+function language_css_alter(&$css) {
+  global $language;
+
+  // If the current language is RTL, add the CSS file with the RTL overrides.
+  if ($language->direction == LANGUAGE_RTL) {
+    foreach ($css as $data => $item) {
+      // Only provide RTL overrides for files.
+      if ($item['type'] == 'file') {
+        $rtl_path = str_replace('.css', '-rtl.css', $item['data']);
+        if (file_exists($rtl_path) && !isset($css[$rtl_path])) {
+          // Replicate the same item, but with the RTL path and a little larger
+          // weight so that it appears directly after the original CSS file.
+          $item['data'] = $rtl_path;
+          $item['weight'] += 0.01;
+          $css[$rtl_path] = $item;
+        }
+      }
+    }
+  }
+}
diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index fea7241..9330df1 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -902,33 +902,6 @@
   }
 }
 
-/**
- * Implements hook_css_alter().
- *
- * This function checks all CSS files currently added via drupal_add_css() and
- * and checks to see if a related right to left CSS file should be included.
- */
-function locale_css_alter(&$css) {
-  global $language;
-
-  // If the current language is RTL, add the CSS file with the RTL overrides.
-  if ($language->direction == LANGUAGE_RTL) {
-    foreach ($css as $data => $item) {
-      // Only provide RTL overrides for files.
-      if ($item['type'] == 'file') {
-        $rtl_path = str_replace('.css', '-rtl.css', $item['data']);
-        if (file_exists($rtl_path) && !isset($css[$rtl_path])) {
-          // Replicate the same item, but with the RTL path and a little larger
-          // weight so that it appears directly after the original CSS file.
-          $item['data'] = $rtl_path;
-          $item['weight'] += 0.01;
-          $css[$rtl_path] = $item;
-        }
-      }
-    }
-  }
-}
-
  /**
  * Implement hook_library_info_alter().
  *
diff --git a/core/modules/simpletest/tests/common.test b/core/modules/simpletest/tests/common.test
index b07ad18..a64dbc0 100644
--- a/core/modules/simpletest/tests/common.test
+++ b/core/modules/simpletest/tests/common.test
@@ -591,7 +591,7 @@
   }
 
   function setUp() {
-    parent::setUp('php', 'locale', 'common_test');
+    parent::setUp('php', 'language', 'common_test');
     // Reset drupal_add_css() before each test.
     drupal_static_reset('drupal_add_css');
   }
