Proper directionality for entry points table
authorAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Mon, 29 Oct 2012 13:30:47 +0000 (15:30 +0200)
committerAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Mon, 29 Oct 2012 21:26:11 +0000 (23:26 +0200)
The entry points table inherited the interface language's
dir and lang values. This caused weird display in RTL languages
and possible problems with webfonts, which work with the lang attribute.

This commit sets explicit lang="en" dir="ltr" for the whole entry points
table and explicit lang and dir of the current interface language for
the table headings.

Change-Id: I396ec98b4ea14d06bf91002b6bc4a293c09fdb33

includes/specials/SpecialVersion.php

index 87ea943..e0c6d12 100644 (file)
@@ -775,11 +775,23 @@ class SpecialVersion extends SpecialPage {
                        'version-entrypoints-load-php' => wfScript( 'load' ),
                );
 
+               $language = $this->getLanguage();
+               $thAttribures = array(
+                       'dir' => $language->getDir(),
+                       'lang' => $language->getCode()
+               );
                $out = Html::element( 'h2', array( 'id' => 'mw-version-entrypoints' ), $this->msg( 'version-entrypoints' )->text() ) .
-                       Html::openElement( 'table', array( 'class' => 'wikitable plainlinks', 'id' => 'mw-version-entrypoints-table' ) ) .
+                       Html::openElement( 'table',
+                               array(
+                                       'class' => 'wikitable plainlinks',
+                                       'id' => 'mw-version-entrypoints-table',
+                                       'dir' => 'ltr',
+                                       'lang' => 'en'
+                               )
+                       ) .
                        Html::openElement( 'tr' ) .
-                       Html::element( 'th', array(), $this->msg( 'version-entrypoints-header-entrypoint' )->text() ) .
-                       Html::element( 'th', array(), $this->msg( 'version-entrypoints-header-url' )->text() ) .
+                       Html::element( 'th', $thAttribures, $this->msg( 'version-entrypoints-header-entrypoint' )->text() ) .
+                       Html::element( 'th', $thAttribures, $this->msg( 'version-entrypoints-header-url' )->text() ) .
                        Html::closeElement( 'tr' );
 
                foreach ( $entryPoints as $message => $value ) {