Replace deprecated Language::fetchLanguageNames
Bug: T325962 Change-Id: I8d5724cd9b79639a0b2001759a70b8d8106c74ee
This commit is contained in:
@@ -24,6 +24,9 @@ if ( $IP === false ) {
|
||||
}
|
||||
require_once "$IP/maintenance/Maintenance.php";
|
||||
|
||||
use MediaWiki\Languages\LanguageNameUtils;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
|
||||
class LanguageNameIndexer extends Maintenance {
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
@@ -51,7 +54,8 @@ class LanguageNameIndexer extends Maintenance {
|
||||
// Languages and their names in different languages from Names.php and the cldr extension
|
||||
// This comes after $ulsLanguages so that for example the als/gsw mixup is using the code
|
||||
// used in the Wikimedia world.
|
||||
$mwLanguages = Language::fetchLanguageNames( null, 'all' );
|
||||
$mwLanguages = MediaWikiServices::getInstance()->getLanguageNameUtils()
|
||||
->getLanguageNames( LanguageNameUtils::AUTONYMS, LanguageNameUtils::ALL );
|
||||
foreach ( array_keys( $mwLanguages ) as $languageCode ) {
|
||||
$languageNames[ $languageCode ] = LanguageNames::getNames( $languageCode, 0, 2 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user