Index: trunk/extensions/CentralNotice/SpecialCentralNotice.php |
— | — | @@ -1519,9 +1519,19 @@ |
1520 | 1520 | function languageMultiSelector( $selected = array(), $customisedOnly = true ) { |
1521 | 1521 | global $wgLanguageCode, $wgExtensionAssetsPath, $wgLang; |
1522 | 1522 | $scriptPath = "$wgExtensionAssetsPath/CentralNotice"; |
| 1523 | + if ( is_callable( array( 'LanguageNames', 'getNames' ) ) ) { |
| 1524 | + // Retrieve the list of languages in user's language (via CLDR) |
| 1525 | + $languages = LanguageNames::getNames( |
| 1526 | + $wgLang->getCode(), // User's language |
| 1527 | + LanguageNames::FALLBACK_NORMAL, // Use fallback chain |
| 1528 | + LanguageNames::LIST_MW // Pull all languages that are in Names.php |
| 1529 | + ); |
| 1530 | + } else { |
| 1531 | + // Use this as fallback if CLDR extension is not enabled |
| 1532 | + $languages = Language::getLanguageNames(); |
| 1533 | + } |
1523 | 1534 | // Make sure the site language is in the list; a custom language code |
1524 | 1535 | // might not have a defined name... |
1525 | | - $languages = Language::getLanguageNames(); |
1526 | 1536 | if( !array_key_exists( $wgLanguageCode, $languages ) ) { |
1527 | 1537 | $languages[$wgLanguageCode] = $wgLanguageCode; |
1528 | 1538 | } |