From: Brion Vibber Date: Thu, 18 Oct 2007 15:07:55 +0000 (+0000) Subject: Cleanup r26692: X-Git-Tag: 1.31.0-rc.0~51116 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=3ef37ae1286b9271c6618e6b9addb7717318b638;p=lhc%2Fweb%2Fwiklou.git Cleanup r26692: * Use content language, not UI language, when adding language suffix to OpenSearch description * Use $wgContLang->getLanguageName() instead of grabbing a whole array of every name ever :) * If there isn't a defined language name for this code, don't spew a PHP notice and output "()". Use the language code instead, so non-standard and as-yet-unused languages won't break. --- diff --git a/includes/Skin.php b/includes/Skin.php index 2b90bd9f21..40f8b9f71d 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -156,7 +156,7 @@ class Skin extends Linker { } function initPage( &$out ) { - global $wgFavicon, $wgScriptPath, $wgSitename, $wgLanguageCode; + global $wgFavicon, $wgScriptPath, $wgSitename, $wgContLang; wfProfileIn( __METHOD__ ); @@ -164,14 +164,16 @@ class Skin extends Linker { $out->addLink( array( 'rel' => 'shortcut icon', 'href' => $wgFavicon ) ); } - $names = Language::getLanguageNames(); + $code = $wgContLang->getCode(); + $name = $wgContLang->getLanguageName( $code ); + $langName = $name ? $name : $code; # OpenSearch description link $out->addLink( array( 'rel' => 'search', 'type' => 'application/opensearchdescription+xml', 'href' => "$wgScriptPath/opensearch_desc.php", - 'title' => "$wgSitename ({$names[$wgLanguageCode]})", + 'title' => "$wgSitename ($langName)", )); $this->addMetadataLinks($out);