mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-27 17:50:06 +00:00
Replace deprecated Language::fetchLanguageName(s)
Bug: T325962 Change-Id: Iff57224d231480507f138f9ba51f385ed32bf5b1
This commit is contained in:
parent
b0cbcfffbf
commit
e76dff032d
|
@ -127,7 +127,8 @@ class LanguageLibrary extends LibraryBase {
|
|||
public function fetchLanguageName( $code, $inLanguage ) {
|
||||
$this->checkType( 'fetchLanguageName', 1, $code, 'string' );
|
||||
$this->checkTypeOptional( 'fetchLanguageName', 2, $inLanguage, 'string', null );
|
||||
return [ Language::fetchLanguageName( $code, $inLanguage ) ];
|
||||
return [ MediaWikiServices::getInstance()->getLanguageNameUtils()
|
||||
->getLanguageName( $code, $inLanguage ) ];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -140,7 +141,8 @@ class LanguageLibrary extends LibraryBase {
|
|||
public function fetchLanguageNames( $inLanguage, $include ) {
|
||||
$this->checkTypeOptional( 'fetchLanguageNames', 1, $inLanguage, 'string', null );
|
||||
$this->checkTypeOptional( 'fetchLanguageNames', 2, $include, 'string', 'mw' );
|
||||
return [ Language::fetchLanguageNames( $inLanguage, $include ) ];
|
||||
return [ MediaWikiServices::getInstance()->getLanguageNameUtils()
|
||||
->getLanguageNames( $inLanguage, $include ) ];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace MediaWiki\Extension\Scribunto\Tests\Engines\LuaCommon;
|
||||
|
||||
use Language;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use Title;
|
||||
|
||||
|
@ -20,7 +19,7 @@ class LanguageLibraryTest extends LuaEngineUnitTestBase {
|
|||
|
||||
// Skip certain tests if something isn't providing translated language names
|
||||
// (bug 67343)
|
||||
if ( Language::fetchLanguageName( 'en', 'fr' ) === 'English' ) {
|
||||
if ( MediaWikiServices::getInstance()->getLanguageNameUtils()->getLanguageName( 'en', 'fr' ) === 'English' ) {
|
||||
$msg = 'Language name translations are unavailable; ' .
|
||||
'install Extension:CLDR or something similar';
|
||||
$this->skipTests += [
|
||||
|
|
Loading…
Reference in a new issue