Fix the display of the libraries in Special:Version for RTL wikis
authorAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Fri, 7 Aug 2015 14:35:05 +0000 (17:35 +0300)
committerAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Fri, 7 Aug 2015 14:35:05 +0000 (17:35 +0300)
Bug: T108325
Change-Id: I3c9a675fa7330d46090a64c003bcaf66ddf4260f

includes/specials/SpecialVersion.php

index 4fb6772..e598f0b 100644 (file)
@@ -541,6 +541,10 @@ class SpecialVersion extends SpecialPage {
                                return $arr['name'];
                        }, $info['authors'] );
                        $authors = $this->listAuthors( $authors, false, "$IP/vendor/$name" );
+
+                       // We can safely assume that the libraries' names and descriptions
+                       // are written in English and aren't going to be translated,
+                       // so set appropriate lang and dir attributes
                        $out .= Html::openElement( 'tr' )
                                . Html::rawElement(
                                        'td',
@@ -551,9 +555,9 @@ class SpecialVersion extends SpecialPage {
                                                array( 'class' => 'mw-version-library-name' )
                                        )
                                )
-                               . Html::element( 'td', array(), $info['version'] )
-                               . Html::element( 'td', array(), $this->listToText( $info['licenses'] ) )
-                               . Html::element( 'td', array(), $info['description'] )
+                               . Html::element( 'td', array( 'dir' => 'auto' ), $info['version'] )
+                               . Html::element( 'td', array( 'dir' => 'auto' ), $this->listToText( $info['licenses'] ) )
+                               . Html::element( 'td', array( 'lang' => 'en', 'dir' => 'ltr' ), $info['description'] )
                                . Html::rawElement( 'td', array(), $authors )
                                . Html::closeElement( 'tr' );
                }