aboutsummaryrefslogtreecommitdiffstats
path: root/includes/SkinTemplate.php
diff options
context:
space:
mode:
authorPavel Selitskas <p.selitskas@gmail.com>2012-11-29 13:42:17 +0300
committerPavel Selitskas <p.selitskas@gmail.com>2013-10-04 17:44:24 +0300
commit0d7a30fa27ebaefb5d89693bbe658916b982c082 (patch)
treee584caafbc7f5843257e08a25b9aa933d2e9b238 /includes/SkinTemplate.php
parentaa6f866bd196e666b9c6e295733276d6a018dbba (diff)
downloadmediawikicore-0d7a30fa27ebaefb5d89693bbe658916b982c082.tar.gz
mediawikicore-0d7a30fa27ebaefb5d89693bbe658916b982c082.zip
Mouseover explanations for interlanguage links in native language
Adds a language name in User's language from CLDR to an interwiki 'title' attribute. Believed to be RTL-compilant. New message added: tooltip-iwiki, added to $preloadedMessages Bug: 5231 Change-Id: I3dcb00cdc28a10711b6703fa509b8b8d06e325a2
Diffstat (limited to 'includes/SkinTemplate.php')
-rw-r--r--includes/SkinTemplate.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php
index ccfb3dbe8ce8..d968d7957359 100644
--- a/includes/SkinTemplate.php
+++ b/includes/SkinTemplate.php
@@ -131,6 +131,7 @@ class SkinTemplate extends Skin {
public function getLanguages() {
global $wgHideInterlanguageLinks;
$out = $this->getOutput();
+ $userLang = $this->getLanguage();
# Language links
$language_urls = array();
@@ -151,10 +152,14 @@ class SkinTemplate extends Skin {
$ilLangName = $this->formatLanguageName( $ilLangName );
}
+ // CLDR extension or similar is required to localize the language name;
+ // otherwise we'll end up with the autonym again.
+ $ilLangLocalName = Language::fetchLanguageName( $ilInterwikiCode, $userLang->getCode() );
+
$language_urls[] = array(
'href' => $languageLinkTitle->getFullURL(),
'text' => $ilLangName,
- 'title' => $languageLinkTitle->getText(),
+ 'title' => wfMessage( 'tooltip-iwiki', $languageLinkTitle->getText(), $ilLangLocalName )->escaped(),
'class' => $class,
'lang' => wfBCP47( $ilInterwikiCode ),
'hreflang' => wfBCP47( $ilInterwikiCode ),