$tpl->setRef( 'userpage', $this->userpage );
$tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href'] );
$tpl->set( 'userlang', $wgLang->getCode() );
- $tpl->set( 'userlangattributes', 'lang="' . $wgLang->getCode() . '" xml:lang="' . $wgLang->getCode() . '" dir="' . $wgLang->getDir() . '"');
+
+ // Users can have their language set differently than the
+ // content of the wiki. For these users, tell the web browser
+ // that interface elements are in a different language.
+ $tpl->set( 'userlangattributes', '');
+ $tpl->set( 'specialpageattributes', '');
+
+ $code = $wgLang->getCode();
+ $dir = $wgLang->getDir();
+ if ( $code !== $wgContLang->getCode() || $dir !== $wgContLang->getDir() ) {
+ $attrs = "lang='$lang' xml:lang='$lang' dir='$dir'";
+
+ $tpl->set( 'userlangattributes', $attrs );
+
+ // The content of SpecialPages should be presented in the
+ // user's language. Content of regular pages should not be touched.
+ if($this->mTitle->isSpecialPage()) {
+ $tpl->set( 'specialpageattributes', $attrs );
+ }
+ }
$newtalks = $wgUser->getNewMessageLinks();
<!-- contentholder does nothing by default, but it allows users to style the text inside
the content area without affecting the meaning of 'em' in #mw_content, which is used
for the margins -->
- <div id="mw_contentholder" <?php $this->html("userlangattributes") ?>>
+ <div id="mw_contentholder" <?php $this->html("specialpageattributes") ?>>
<div class='mw-topboxes'>
<div id="mw-js-message" style="display:none;" <?php $this->html('userlangattributes')?>></div>
<div class="mw-topbox" id="siteSub"><?php $this->msg('tagline') ?></div>
class="mediawiki <?php $this->text('dir'); $this->text('capitalizeallnouns') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>">
<div id="globalWrapper">
<div id="column-content">
- <div id="content" <?php $this->html("userlangattributes") ?>>
+ <div id="content" <?php $this->html("specialpageattributes") ?>>
<a id="top"></a>
<?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
<h1 id="firstHeading" class="firstHeading"><?php $this->html('title') ?></h1>
<div id="page-base" class="noprint"></div>
<div id="head-base" class="noprint"></div>
<!-- content -->
- <div id="content" <?php $this->html('userlangattributes') ?>>
+ <div id="content" <?php $this->html('specialpageattributes') ?>>
<a id="top"></a>
<div id="mw-js-message" style="display:none;" <?php $this->html('userlangattributes') ?>></div>
<?php if ( $this->data['sitenotice'] ): ?>