(part of bug 6100) Set the directionality based on user language instead of content...
authorRobin Pepermans <robin@users.mediawiki.org>
Fri, 17 Jun 2011 11:32:42 +0000 (11:32 +0000)
committerRobin Pepermans <robin@users.mediawiki.org>
Fri, 17 Jun 2011 11:32:42 +0000 (11:32 +0000)
includes/resourceloader/ResourceLoaderContext.php

index 33859f0..d391f63 100644 (file)
@@ -140,8 +140,11 @@ class ResourceLoaderContext {
                if ( $this->direction === null ) {
                        $this->direction = $this->request->getVal( 'dir' );
                        if ( !$this->direction ) {
-                               global $wgContLang;
-                               $this->direction = $wgContLang->getDir();
+                               global $wgBetterDirectionality, $wgContLang;
+                               // if $wgBetterDirectionality is true, set
+                               // directionality based on user language (see bug 6100)
+                               $this->direction = ( $wgBetterDirectionality ?
+                                       Language::factory( $this->language )->getDir() : $wgContLang->getDir() );
                        }
                }
                return $this->direction;