Index: trunk/phase3/skins/MonoBook.php |
— | — | @@ -81,7 +81,7 @@ |
82 | 82 | class="mediawiki <?php $this->text('dir'); $this->text('capitalizeallnouns') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>"> |
83 | 83 | <div id="globalWrapper"> |
84 | 84 | <div id="column-content"> |
85 | | - <div id="content" <?php $this->html("userlangattributes") ?>> |
| 85 | + <div id="content" <?php $this->html("specialpageattributes") ?>> |
86 | 86 | <a id="top"></a> |
87 | 87 | <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?> |
88 | 88 | <h1 id="firstHeading" class="firstHeading"><?php $this->html('title') ?></h1> |
Index: trunk/phase3/skins/Modern.php |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | <!-- contentholder does nothing by default, but it allows users to style the text inside |
115 | 115 | the content area without affecting the meaning of 'em' in #mw_content, which is used |
116 | 116 | for the margins --> |
117 | | - <div id="mw_contentholder" <?php $this->html("userlangattributes") ?>> |
| 117 | + <div id="mw_contentholder" <?php $this->html("specialpageattributes") ?>> |
118 | 118 | <div class='mw-topboxes'> |
119 | 119 | <div id="mw-js-message" style="display:none;" <?php $this->html('userlangattributes')?>></div> |
120 | 120 | <div class="mw-topbox" id="siteSub"><?php $this->msg('tagline') ?></div> |
Index: trunk/phase3/skins/Vector.php |
— | — | @@ -463,7 +463,7 @@ |
464 | 464 | <div id="page-base" class="noprint"></div> |
465 | 465 | <div id="head-base" class="noprint"></div> |
466 | 466 | <!-- content --> |
467 | | - <div id="content" <?php $this->html('userlangattributes') ?>> |
| 467 | + <div id="content" <?php $this->html('specialpageattributes') ?>> |
468 | 468 | <a id="top"></a> |
469 | 469 | <div id="mw-js-message" style="display:none;" <?php $this->html('userlangattributes') ?>></div> |
470 | 470 | <?php if ( $this->data['sitenotice'] ): ?> |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -304,8 +304,27 @@ |
305 | 305 | $tpl->setRef( 'userpage', $this->userpage ); |
306 | 306 | $tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href'] ); |
307 | 307 | $tpl->set( 'userlang', $wgLang->getCode() ); |
308 | | - $tpl->set( 'userlangattributes', 'lang="' . $wgLang->getCode() . '" xml:lang="' . $wgLang->getCode() . '" dir="' . $wgLang->getDir() . '"'); |
309 | 308 | |
| 309 | + // Users can have their language set differently than the |
| 310 | + // content of the wiki. For these users, tell the web browser |
| 311 | + // that interface elements are in a different language. |
| 312 | + $tpl->set( 'userlangattributes', ''); |
| 313 | + $tpl->set( 'specialpageattributes', ''); |
| 314 | + |
| 315 | + $code = $wgLang->getCode(); |
| 316 | + $dir = $wgLang->getDir(); |
| 317 | + if ( $code !== $wgContLang->getCode() || $dir !== $wgContLang->getDir() ) { |
| 318 | + $attrs = "lang='$lang' xml:lang='$lang' dir='$dir'"; |
| 319 | + |
| 320 | + $tpl->set( 'userlangattributes', $attrs ); |
| 321 | + |
| 322 | + // The content of SpecialPages should be presented in the |
| 323 | + // user's language. Content of regular pages should not be touched. |
| 324 | + if($this->mTitle->isSpecialPage()) { |
| 325 | + $tpl->set( 'specialpageattributes', $attrs ); |
| 326 | + } |
| 327 | + } |
| 328 | + |
310 | 329 | $newtalks = $wgUser->getNewMessageLinks(); |
311 | 330 | |
312 | 331 | if( count( $newtalks ) == 1 && $newtalks[0]['wiki'] === wfWikiID() ) { |