Add the titles of interlanguage links to the tooltip of those pages (title attribute)
authorDerk-Jan Hartman <hartman@users.mediawiki.org>
Tue, 15 Jun 2010 15:06:11 +0000 (15:06 +0000)
committerDerk-Jan Hartman <hartman@users.mediawiki.org>
Tue, 15 Jun 2010 15:06:11 +0000 (15:06 +0000)
RELEASE-NOTES
includes/Skin.php
includes/SkinTemplate.php
skins/MonoBook.php
skins/Vector.php

index 8224914..b912955 100644 (file)
@@ -82,6 +82,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   experimental feature.
 * Show validity period of the login cookie in Special:UserLogin and
   Special:Preferences
+* Interlanguage links display the page title in their tooltip.
 
 === Bug fixes in 1.17 ===
 * (bug 17560) Half-broken deletion moved image files to deletion archive
index c28e604..c21bbc9 100644 (file)
@@ -1894,12 +1894,13 @@ CSS;
                        $nt = Title::newFromText( $l );
                        $url = $nt->escapeFullURL();
                        $text = $wgContLang->getLanguageName( $nt->getInterwiki() );
+                       $title = htmlspecialchars( $nt->getText() );
 
                        if ( $text == '' ) {
                                $text = $l;
                        }
                        $style = $this->getExternalLinkAttributes();
-                       $s .= "<a href=\"{$url}\"{$style}>{$text}</a>";
+                       $s .= "<a href=\"{$url}\" title=\"{$title}\"{$style}>{$text}</a>";
                }
                if( $wgContLang->isRTL() ) {
                        $s .= '</span>';
index 1a531fe..e795291 100644 (file)
@@ -433,6 +433,7 @@ class SkinTemplate extends Skin {
                                                'href' => $nt->getFullURL(),
                                                'text' => ( $wgContLang->getLanguageName( $nt->getInterwiki() ) != '' ?
                                                                        $wgContLang->getLanguageName( $nt->getInterwiki() ) : $l ),
+                                               'title' => $nt->getText(),
                                                'class' => $class
                                        );
                                }
index bfe9b41..82c1b55 100644 (file)
@@ -310,7 +310,8 @@ if($this->data['copyrightico']) { ?>
                        <ul>
 <?php          foreach($this->data['language_urls'] as $langlink) { ?>
                                <li class="<?php echo htmlspecialchars($langlink['class'])?>"><?php
-                               ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>"><?php echo $langlink['text'] ?></a></li>
+                               ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>" title="<?php
+                               echo htmlspecialchars($langlink['title']) ?>"><?php echo $langlink['text'] ?></a></li>
 <?php          } ?>
                        </ul>
                </div>
index 2217de8..279c795 100644 (file)
@@ -639,7 +639,7 @@ class VectorTemplate extends QuickTemplate {
        <div class="body">
                <ul>
                <?php foreach ( $this->data['language_urls'] as $langlink ): ?>
-                       <li class="<?php echo htmlspecialchars(  $langlink['class'] ) ?>"><a href="<?php echo htmlspecialchars( $langlink['href'] ) ?>"><?php echo $langlink['text'] ?></a></li>
+                       <li class="<?php echo htmlspecialchars(  $langlink['class'] ) ?>"><a href="<?php echo htmlspecialchars( $langlink['href'] ) ?>" title="<?php echo htmlspecialchars( $langlink['title'] ) ?>"><?php echo $langlink['text'] ?></a></li>
                <?php endforeach; ?>
                </ul>
        </div>