* (bug 4901) lang, hreflang attributes added to sidebar interlanguage links
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 30 Nov 2011 23:17:19 +0000 (23:17 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 30 Nov 2011 23:17:19 +0000 (23:17 +0000)
The lang attribute assists screen readers in reading out the language name correctly; see sample recordings from iOS's VoiceOver reader mode attached on <https://bugzilla.wikimedia.org/show_bug.cgi?id=4901>
hreflang attribute is less clearly useful, but may assist some tools in indicating the language of the destination site.

Inline interwiki links have not been changed.

Release notes will be added on 1.18 channel, this is an old bug fix and easy to backport.

includes/SkinTemplate.php

index 504c393..c56bd6f 100644 (file)
@@ -441,7 +441,9 @@ class SkinTemplate extends Skin {
                                                'text' => ( $wgContLang->getLanguageName( $nt->getInterwiki() ) != '' ?
                                                                        $wgContLang->getLanguageName( $nt->getInterwiki() ) : $l ),
                                                'title' => $nt->getText(),
-                                               'class' => $class
+                                               'class' => $class,
+                                               'lang' => $nt->getInterwiki(),
+                                               'hreflang' => $nt->getInterwiki(),
                                        );
                                }
                        }