From: Ebrahim Date: Sun, 2 Aug 2015 23:08:37 +0000 (+0000) Subject: i18n: Make noarticletext direction aware X-Git-Tag: 1.31.0-rc.0~10404 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=7e283d72488a318c57ba4ac64b43ed2198595dec;p=lhc%2Fweb%2Fwiklou.git i18n: Make noarticletext direction aware Currently https://fa.wikipedia.org/wiki/MediaWiki:TEST.js?uselang=fa is displaying "noarticletext" in LTR which is wrong. Bug: T60685 Change-Id: I4dc76dc1c5134c0dbe0988d6d0a3286a0e52242f --- diff --git a/includes/page/Article.php b/includes/page/Article.php index e58ffc8514..54db19ce0a 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -1270,7 +1270,13 @@ class Article implements Page { $text = wfMessage( 'noarticletext-nopermission' )->plain(); } - $outputPage->addWikiText( "
\n$text\n
" ); + $dir = $this->getContext()->getLanguage()->getDir(); + $lang = $this->getContext()->getLanguage()->getCode(); + $outputPage->addWikiText( Xml::openElement( 'div', array( + 'class' => "noarticletext mw-content-$dir", + 'dir' => $dir, + 'lang' => $lang, + ) ) . "\n$text\n" ); } }