Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -113,7 +113,13 @@ |
114 | 114 | |
115 | 115 | # No need to display noarticletext, we use our own message, output in openShowImage() |
116 | 116 | if ( $this->getID() ) { |
| 117 | + # When $wgBetterDirectionality is enabled, NS_FILE is in the user language, |
| 118 | + # but this section (the actual wikitext) should be in page content language |
| 119 | + $pageLang = $this->mTitle->getPageLanguage(); |
| 120 | + $wgOut->addHTML( Xml::openElement( 'div', array( 'id' => 'mw-imagepage-content', |
| 121 | + 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() ) ) ); |
117 | 122 | parent::view(); |
| 123 | + $wgOut->addHTML( Xml::closeElement( 'div' ) ); |
118 | 124 | } else { |
119 | 125 | # Just need to set the right headers |
120 | 126 | $wgOut->setArticleFlag( true ); |
— | — | @@ -302,7 +308,7 @@ |
303 | 309 | |
304 | 310 | protected function openShowImage() { |
305 | 311 | global $wgOut, $wgUser, $wgImageLimits, $wgRequest, |
306 | | - $wgLang, $wgContLang, $wgEnableUploads; |
| 312 | + $wgLang, $wgEnableUploads; |
307 | 313 | |
308 | 314 | $this->loadFile(); |
309 | 315 | |
— | — | @@ -321,7 +327,7 @@ |
322 | 328 | $maxWidth = $max[0]; |
323 | 329 | $maxHeight = $max[1]; |
324 | 330 | $sk = $wgUser->getSkin(); |
325 | | - $dirmark = $wgContLang->getDirMark(); |
| 331 | + $dirmark = wfUILang()->getDirMark(); |
326 | 332 | |
327 | 333 | if ( $this->displayImg->exists() ) { |
328 | 334 | # image |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -456,9 +456,9 @@ |
457 | 457 | |
458 | 458 | global $wgBetterDirectionality; |
459 | 459 | if ( $wgBetterDirectionality ) { |
460 | | - // not for special pages AND only when viewing AND if the page exists |
| 460 | + // not for special pages or file pages AND only when viewing AND if the page exists |
461 | 461 | // (or is in MW namespace, because that has default content) |
462 | | - if( $this->getTitle()->getNamespace() != NS_SPECIAL && |
| 462 | + if( !in_array( $this->getTitle()->getNamespace(), array( NS_SPECIAL, NS_FILE ) ) && |
463 | 463 | in_array( $action, array( 'view', 'render', 'print' ) ) && |
464 | 464 | ( $this->getTitle()->exists() || $this->getTitle()->getNamespace() == NS_MEDIAWIKI ) ) { |
465 | 465 | $pageLang = $this->getTitle()->getPageLanguage(); |