Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -455,8 +455,19 @@ |
456 | 456 | $tpl->set( 'printfooter', $this->printSource() ); |
457 | 457 | |
458 | 458 | global $wgBetterDirectionality; |
459 | | - if ( $wgBetterDirectionality ) { |
460 | | - $realBodyAttribs = array( 'lang' => $wgLanguageCode, 'dir' => $wgContLang->getDir() ); |
| 459 | + if ( $wgBetterDirectionality && $this->getTitle()->getNamespace() != NS_SPECIAL ) { |
| 460 | + if( $this->getTitle()->getNamespace() == NS_MEDIAWIKI ) { |
| 461 | + // If the page is in the MediaWiki NS, the lang and dir attribute should depend on that, |
| 462 | + // i.e. MediaWiki:Message/ar -> lang=ar, dir=rtl. This assumes every message is translated, |
| 463 | + // but it's anyway better than assuming it is always in the content lang |
| 464 | + $nsMWTitle = $wgContLang->lcfirst( $this->getTitle()->getText() ); |
| 465 | + list( $nsMWName, $nsMWLang ) = MessageCache::singleton()->figureMessage( $nsMWTitle ); |
| 466 | + $nsMWDir = Language::factory( $nsMWLang )->getDir(); |
| 467 | + $realBodyAttribs = array( 'lang' => $nsMWLang, 'dir' => $nsMWDir ); |
| 468 | + } else { |
| 469 | + // Body text is in the site content language (see also bug 6100 and 28970) |
| 470 | + $realBodyAttribs = array( 'lang' => $wgLanguageCode, 'dir' => $wgContLang->getDir() ); |
| 471 | + } |
461 | 472 | $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext ); |
462 | 473 | } |
463 | 474 | $tpl->setRef( 'bodytext', $out->mBodytext ); |