Properly mark the language and direction of the readonly textarea
authorRobin Pepermans <robin@users.mediawiki.org>
Sat, 27 Aug 2011 21:46:39 +0000 (21:46 +0000)
committerRobin Pepermans <robin@users.mediawiki.org>
Sat, 27 Aug 2011 21:46:39 +0000 (21:46 +0000)
includes/OutputPage.php

index 504db29..e4336a1 100644 (file)
@@ -2087,12 +2087,15 @@ class OutputPage extends ContextSource {
                if( is_string( $source ) ) {
                        $this->addWikiMsg( 'viewsourcetext' );
 
+                       $pageLang = $this->getTitle()->getPageLanguage();
                        $params = array(
                                'id'   => 'wpTextbox1',
                                'name' => 'wpTextbox1',
                                'cols' => $this->getUser()->getOption( 'cols' ),
                                'rows' => $this->getUser()->getOption( 'rows' ),
-                               'readonly' => 'readonly'
+                               'readonly' => 'readonly',
+                               'lang' => $pageLang->getCode(),
+                               'dir' => $pageLang->getDir(),
                        );
                        $this->addHTML( Html::element( 'textarea', $params, $source ) );