From: Niklas Laxström Date: Thu, 6 Dec 2007 16:49:48 +0000 (+0000) Subject: * New configuration variable $wgExtraLanguageNames X-Git-Tag: 1.31.0-rc.0~50525 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=a19ce2e11e082d2cad7bb982afd82464cf4f83fc;p=lhc%2Fweb%2Fwiklou.git * New configuration variable $wgExtraLanguageNames --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index f9cb3f1bb1..bd5100849a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -90,6 +90,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 8396) Ignore out-of-date serialised message caches * (bug 12195) Undeleting pages now requires 'undelete' permission * (bug 11810) Localize displayed semicolons +* New configuration variable $wgExtraLanguageNames === Bug fixes in 1.12 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index cad2e50d16..3cb4235f79 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -729,6 +729,8 @@ $wgInterwikiMagic = true; /** Hide interlanguage links from the sidebar */ $wgHideInterlanguageLinks = false; +/** List of language names or overrides for default names in Names.php */ +$wgExtraLanguageNames = array(); /** We speak UTF-8 all the time now, unless some oddities happen */ $wgInputEncoding = 'UTF-8'; diff --git a/languages/Language.php b/languages/Language.php index 79d76f710c..a6e8e9fab6 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -349,9 +349,10 @@ class Language { * If $customisedOnly is true, only returns codes with a messages file */ public static function getLanguageNames( $customisedOnly = false ) { - global $wgLanguageNames; + global $wgLanguageNames, $wgExtraLanguageNames; + $allNames = $wgExtraLanguageNames + $wgLanguageNames; if ( !$customisedOnly ) { - return $wgLanguageNames; + return $allNames; } global $IP; @@ -361,8 +362,8 @@ class Language { $m = array(); if( preg_match( '/Messages([A-Z][a-z_]+)\.php$/', $file, $m ) ) { $code = str_replace( '_', '-', strtolower( $m[1] ) ); - if ( isset( $wgLanguageNames[$code] ) ) { - $names[$code] = $wgLanguageNames[$code]; + if ( isset( $allNames[$code] ) ) { + $names[$code] = $allNames[$code]; } } } @@ -389,11 +390,11 @@ class Language { } function getLanguageName( $code ) { - global $wgLanguageNames; - if ( ! array_key_exists( $code, $wgLanguageNames ) ) { + $names = self::getLanguageNames(); + if ( !array_key_exists( $code, $names ) ) { return ''; } - return $wgLanguageNames[$code]; + return $names[$code]; } function getMonthName( $key ) {