From: MatmaRex Date: Fri, 5 Oct 2012 16:00:49 +0000 (+0200) Subject: SkinTemplate: extract formatLanguageName() from outputPage() X-Git-Tag: 1.31.0-rc.0~21923^2~3 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=f05901367b297e303530482171c452b158da3161;p=lhc%2Fweb%2Fwiklou.git SkinTemplate: extract formatLanguageName() from outputPage() This is to allow skins to override it; for example, CologneBlue needs the names *not* to be uppercased, as they're not actually displayed in the sidebar. Change-Id: I91d505159c9e9e468182ebbff6002e5238e34f90 --- diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 457e35ea08..c6547473cb 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -423,7 +423,7 @@ class SkinTemplate extends Skin { if ( strval( $ilLangName ) === '' ) { $ilLangName = $l; } else { - $ilLangName = $this->getLanguage()->ucfirst( $ilLangName ); + $ilLangName = $this->formatLanguageName( $ilLangName ); } $language_urls[] = array( 'href' => $nt->getFullURL(), @@ -498,6 +498,17 @@ class SkinTemplate extends Skin { wfProfileOut( __METHOD__ ); } + /** + * Format language name for use in sidebar interlanguage links list. + * By default it is capitalized. + * + * @param $name string Language name, e.g. "English" or "español" + * @private + */ + function formatLanguageName( $name ) { + return $this->getLanguage()->ucfirst( $name ); + } + /** * Output the string, or print error message if it's * an error object of the appropriate type.