Bug 37705 - ucfirst for sidebar interlanguage links
authorrobin <robinp.1273@gmail.com>
Mon, 18 Jun 2012 21:23:59 +0000 (23:23 +0200)
committerNiklas Laxström <niklas.laxstrom@gmail.com>
Thu, 21 Jun 2012 11:32:06 +0000 (11:32 +0000)
Change-Id: I623cf070fdc62c9394a06d4830dc4faccfebcfbe

includes/SkinTemplate.php

index aee2e83..906c27d 100644 (file)
@@ -426,10 +426,15 @@ class SkinTemplate extends Skin {
                                unset( $tmp );
                                $nt = Title::newFromText( $l );
                                if ( $nt ) {
+                                       $ilLangName = Language::fetchLanguageName( $nt->getInterwiki() );
+                                       if ( strval( $ilLangName ) === '' ) {
+                                               $ilLangName = $l;
+                                       } else {
+                                               $ilLangName = $this->getLanguage()->ucfirst( $ilLangName );
+                                       }
                                        $language_urls[] = array(
                                                'href' => $nt->getFullURL(),
-                                               'text' => ( Language::fetchLanguageName( $nt->getInterwiki() ) != '' ?
-                                                                       Language::fetchLanguageName( $nt->getInterwiki() ) : $l ),
+                                               'text' => $ilLangName,
                                                'title' => $nt->getText(),
                                                'class' => $class,
                                                'lang' => $nt->getInterwiki(),