*/
$wgEdititis = false;
+/**
+ * Experimental better directionality support.
+ */
+$wgBetterDirectionality = false;
+
+
/** @} */ # End of output format settings }
/*************************************************************************//**
return $wgContLang;
}
+function wfUILang() {
+ global $wgBetterDirectionality;
+ return wfGetLangObj( $wgBetterDirectionality ? false: true );
+}
+
/**
* Get a message from anywhere, for the current user language.
*
$attribs["xmlns:$tag"] = $ns;
}
}
- return $ret . Html::openElement( 'html', $attribs ) . "\n";
+ $html = Html::openElement( 'html', $attribs );
+ if ( $html ) $html .= "\n";
+ $ret .= $html;
+ return $ret;
}
/**
}
$sk->setupUserCss( $this );
- $dir = $wgContLang->getDir();
- $htmlAttribs = array( 'lang' => $wgContLanguageCode, 'dir' => $dir );
- $ret = Html::htmlHeader( $htmlAttribs );
+ $ret = Html::htmlHeader( array( 'lang' => wfUILang()->getCode() ) );
if ( $this->getHTMLTitle() == '' ) {
$this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() ) );
}
# Class bloat
+ $dir = wfUILang()->getDir();
$bodyAttrs['class'] = "mediawiki $dir";
if ( $wgLang->capitalizeAllNouns() ) {
*/
protected function styleLink( $style, $options ) {
if( isset( $options['dir'] ) ) {
- global $wgContLang;
- $siteDir = $wgContLang->getDir();
+ $siteDir = wfUILang()->getDir();
if( $siteDir != $options['dir'] ) {
return '';
}
$tpl->setRef( 'scriptpath', $wgScriptPath );
$tpl->setRef( 'serverurl', $wgServer );
$tpl->setRef( 'logopath', $wgLogo );
- $tpl->setRef( 'lang', $wgContLanguageCode );
- $tpl->set( 'dir', $wgContLang->getDir() );
- $tpl->set( 'rtl', $wgContLang->isRTL() );
+
+ $lang = wfUILang();
+ $tpl->set( 'lang', $lang->getCode() );
+ $tpl->set( 'dir', $lang->getDir() );
+ $tpl->set( 'rtl', $lang->isRTL() );
+
$tpl->set( 'capitalizeallnouns', $wgLang->capitalizeAllNouns() ? ' capitalize-all-nouns' : '' );
$tpl->set( 'showjumplinks', $wgUser->getOption( 'showjumplinks' ) );
$tpl->set( 'username', $wgUser->isAnon() ? null : $this->username );
$tpl->set( 'bottomscripts', $this->bottomScripts() );
$printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
+ global $wgBetterDirectionality;
+ if ( $wgBetterDirectionality ) {
+ $realBodyAttribs = array( 'lang' => $wgContLanguageCode, 'dir' => $wgContLang->getDir() );
+ $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext );
+ }
$out->mBodytext .= $printfooter . $this->generateDebugHTML();
$tpl->setRef( 'bodytext', $out->mBodytext );
if ( !is_array( $elements ) ) {
$elements = array( $elements );
// If there's a series of elements, reverse them when in RTL mode
- } else if ( $wgContLang->isRTL() ) {
+ } else if ( wfUILang()->isRTL() ) {
$elements = array_reverse( $elements );
}
// Render elements