| Index: trunk/phase3/includes/DefaultSettings.php |
| — | — | @@ -729,6 +729,8 @@ |
| 730 | 730 | /** Hide interlanguage links from the sidebar */ |
| 731 | 731 | $wgHideInterlanguageLinks = false; |
| 732 | 732 | |
| | 733 | +/** List of language names or overrides for default names in Names.php */ |
| | 734 | +$wgExtraLanguageNames = array(); |
| 733 | 735 | |
| 734 | 736 | /** We speak UTF-8 all the time now, unless some oddities happen */ |
| 735 | 737 | $wgInputEncoding = 'UTF-8'; |
| Index: trunk/phase3/languages/Language.php |
| — | — | @@ -349,9 +349,10 @@ |
| 350 | 350 | * If $customisedOnly is true, only returns codes with a messages file |
| 351 | 351 | */ |
| 352 | 352 | public static function getLanguageNames( $customisedOnly = false ) { |
| 353 | | - global $wgLanguageNames; |
| | 353 | + global $wgLanguageNames, $wgExtraLanguageNames; |
| | 354 | + $allNames = $wgExtraLanguageNames + $wgLanguageNames; |
| 354 | 355 | if ( !$customisedOnly ) { |
| 355 | | - return $wgLanguageNames; |
| | 356 | + return $allNames; |
| 356 | 357 | } |
| 357 | 358 | |
| 358 | 359 | global $IP; |
| — | — | @@ -361,8 +362,8 @@ |
| 362 | 363 | $m = array(); |
| 363 | 364 | if( preg_match( '/Messages([A-Z][a-z_]+)\.php$/', $file, $m ) ) { |
| 364 | 365 | $code = str_replace( '_', '-', strtolower( $m[1] ) ); |
| 365 | | - if ( isset( $wgLanguageNames[$code] ) ) { |
| 366 | | - $names[$code] = $wgLanguageNames[$code]; |
| | 366 | + if ( isset( $allNames[$code] ) ) { |
| | 367 | + $names[$code] = $allNames[$code]; |
| 367 | 368 | } |
| 368 | 369 | } |
| 369 | 370 | } |
| — | — | @@ -389,11 +390,11 @@ |
| 390 | 391 | } |
| 391 | 392 | |
| 392 | 393 | function getLanguageName( $code ) { |
| 393 | | - global $wgLanguageNames; |
| 394 | | - if ( ! array_key_exists( $code, $wgLanguageNames ) ) { |
| | 394 | + $names = self::getLanguageNames(); |
| | 395 | + if ( !array_key_exists( $code, $names ) ) { |
| 395 | 396 | return ''; |
| 396 | 397 | } |
| 397 | | - return $wgLanguageNames[$code]; |
| | 398 | + return $names[$code]; |
| 398 | 399 | } |
| 399 | 400 | |
| 400 | 401 | function getMonthName( $key ) { |
| Index: trunk/phase3/RELEASE-NOTES |
| — | — | @@ -90,6 +90,7 @@ |
| 91 | 91 | * (bug 8396) Ignore out-of-date serialised message caches |
| 92 | 92 | * (bug 12195) Undeleting pages now requires 'undelete' permission |
| 93 | 93 | * (bug 11810) Localize displayed semicolons |
| | 94 | +* New configuration variable $wgExtraLanguageNames |
| 94 | 95 | |
| 95 | 96 | === Bug fixes in 1.12 === |
| 96 | 97 | |