i18n: Make noarticletext direction aware
authorEbrahim <ebrahim@gnu.org>
Sun, 2 Aug 2015 23:08:37 +0000 (23:08 +0000)
committerAmire80 <amir.aharoni@mail.huji.ac.il>
Mon, 17 Aug 2015 08:46:19 +0000 (08:46 +0000)
Currently https://fa.wikipedia.org/wiki/MediaWiki:TEST.js?uselang=fa
is displaying "noarticletext" in LTR which is wrong.

Bug: T60685
Change-Id: I4dc76dc1c5134c0dbe0988d6d0a3286a0e52242f

includes/page/Article.php

index e58ffc8..54db19c 100644 (file)
@@ -1270,7 +1270,13 @@ class Article implements Page {
                                $text = wfMessage( 'noarticletext-nopermission' )->plain();
                        }
 
-                       $outputPage->addWikiText( "<div class='noarticletext'>\n$text\n</div>" );
+                       $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</div>" );
                }
        }