Index: trunk/phase3/skins/Vector.php |
— | — | @@ -682,7 +682,7 @@ |
683 | 683 | if ( !is_array( $elements ) ) { |
684 | 684 | $elements = array( $elements ); |
685 | 685 | // If there's a series of elements, reverse them when in RTL mode |
686 | | - } else if ( $wgContLang->isRTL() ) { |
| 686 | + } else if ( wfUILang()->isRTL() ) { |
687 | 687 | $elements = array_reverse( $elements ); |
688 | 688 | } |
689 | 689 | // Render elements |
Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -561,6 +561,11 @@ |
562 | 562 | return $wgContLang; |
563 | 563 | } |
564 | 564 | |
| 565 | +function wfUILang() { |
| 566 | + global $wgBetterDirectionality; |
| 567 | + return wfGetLangObj( $wgBetterDirectionality ? false: true ); |
| 568 | +} |
| 569 | + |
565 | 570 | /** |
566 | 571 | * Get a message from anywhere, for the current user language. |
567 | 572 | * |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2099,9 +2099,7 @@ |
2100 | 2100 | } |
2101 | 2101 | $sk->setupUserCss( $this ); |
2102 | 2102 | |
2103 | | - $dir = $wgContLang->getDir(); |
2104 | | - $htmlAttribs = array( 'lang' => $wgContLanguageCode, 'dir' => $dir ); |
2105 | | - $ret = Html::htmlHeader( $htmlAttribs ); |
| 2103 | + $ret = Html::htmlHeader( array( 'lang' => wfUILang()->getCode() ) ); |
2106 | 2104 | |
2107 | 2105 | if ( $this->getHTMLTitle() == '' ) { |
2108 | 2106 | $this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() ) ); |
— | — | @@ -2156,6 +2154,7 @@ |
2157 | 2155 | } |
2158 | 2156 | |
2159 | 2157 | # Class bloat |
| 2158 | + $dir = wfUILang()->getDir(); |
2160 | 2159 | $bodyAttrs['class'] = "mediawiki $dir"; |
2161 | 2160 | |
2162 | 2161 | if ( $wgLang->capitalizeAllNouns() ) { |
— | — | @@ -2427,8 +2426,7 @@ |
2428 | 2427 | */ |
2429 | 2428 | protected function styleLink( $style, $options ) { |
2430 | 2429 | if( isset( $options['dir'] ) ) { |
2431 | | - global $wgContLang; |
2432 | | - $siteDir = $wgContLang->getDir(); |
| 2430 | + $siteDir = wfUILang()->getDir(); |
2433 | 2431 | if( $siteDir != $options['dir'] ) { |
2434 | 2432 | return ''; |
2435 | 2433 | } |
Index: trunk/phase3/includes/Html.php |
— | — | @@ -609,7 +609,10 @@ |
610 | 610 | $attribs["xmlns:$tag"] = $ns; |
611 | 611 | } |
612 | 612 | } |
613 | | - return $ret . Html::openElement( 'html', $attribs ) . "\n"; |
| 613 | + $html = Html::openElement( 'html', $attribs ); |
| 614 | + if ( $html ) $html .= "\n"; |
| 615 | + $ret .= $html; |
| 616 | + return $ret; |
614 | 617 | } |
615 | 618 | |
616 | 619 | /** |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -297,9 +297,12 @@ |
298 | 298 | $tpl->setRef( 'scriptpath', $wgScriptPath ); |
299 | 299 | $tpl->setRef( 'serverurl', $wgServer ); |
300 | 300 | $tpl->setRef( 'logopath', $wgLogo ); |
301 | | - $tpl->setRef( 'lang', $wgContLanguageCode ); |
302 | | - $tpl->set( 'dir', $wgContLang->getDir() ); |
303 | | - $tpl->set( 'rtl', $wgContLang->isRTL() ); |
| 301 | + |
| 302 | + $lang = wfUILang(); |
| 303 | + $tpl->set( 'lang', $lang->getCode() ); |
| 304 | + $tpl->set( 'dir', $lang->getDir() ); |
| 305 | + $tpl->set( 'rtl', $lang->isRTL() ); |
| 306 | + |
304 | 307 | $tpl->set( 'capitalizeallnouns', $wgLang->capitalizeAllNouns() ? ' capitalize-all-nouns' : '' ); |
305 | 308 | $tpl->set( 'showjumplinks', $wgUser->getOption( 'showjumplinks' ) ); |
306 | 309 | $tpl->set( 'username', $wgUser->isAnon() ? null : $this->username ); |
— | — | @@ -415,6 +418,11 @@ |
416 | 419 | $tpl->set( 'bottomscripts', $this->bottomScripts() ); |
417 | 420 | |
418 | 421 | $printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n"; |
| 422 | + global $wgBetterDirectionality; |
| 423 | + if ( $wgBetterDirectionality ) { |
| 424 | + $realBodyAttribs = array( 'lang' => $wgContLanguageCode, 'dir' => $wgContLang->getDir() ); |
| 425 | + $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext ); |
| 426 | + } |
419 | 427 | $out->mBodytext .= $printfooter . $this->generateDebugHTML(); |
420 | 428 | $tpl->setRef( 'bodytext', $out->mBodytext ); |
421 | 429 | |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2282,6 +2282,12 @@ |
2283 | 2283 | */ |
2284 | 2284 | $wgEdititis = false; |
2285 | 2285 | |
| 2286 | +/** |
| 2287 | + * Experimental better directionality support. |
| 2288 | + */ |
| 2289 | +$wgBetterDirectionality = false; |
| 2290 | + |
| 2291 | + |
2286 | 2292 | /** @} */ # End of output format settings } |
2287 | 2293 | |
2288 | 2294 | /*************************************************************************//** |