mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/InputBox
synced 2024-11-23 22:54:02 +00:00
Merge "Use services from Parser"
This commit is contained in:
commit
e378b75454
|
@ -11,7 +11,7 @@
|
|||
"url": "https://www.mediawiki.org/wiki/Extension:InputBox",
|
||||
"descriptionmsg": "inputbox-desc",
|
||||
"requires": {
|
||||
"MediaWiki": ">= 1.30.0"
|
||||
"MediaWiki": ">= 1.38.0"
|
||||
},
|
||||
"license-name": "MIT",
|
||||
"type": "parserhook",
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
* @ingroup Extensions
|
||||
*/
|
||||
|
||||
use MediaWiki\MediaWikiServices;
|
||||
|
||||
/**
|
||||
* InputBox class
|
||||
*/
|
||||
|
@ -191,7 +189,7 @@ class InputBox {
|
|||
// Determine namespace checkboxes
|
||||
$namespacesArray = explode( ',', $this->mNamespaces );
|
||||
if ( $this->mNamespaces ) {
|
||||
$contLang = MediaWikiServices::getInstance()->getContentLanguage();
|
||||
$contLang = $this->mParser->getContentLanguage();
|
||||
$namespaces = $contLang->getNamespaces();
|
||||
$nsAliases = array_merge( $contLang->getNamespaceAliases(), $wgNamespaceAliases );
|
||||
$showNamespaces = [];
|
||||
|
@ -745,9 +743,7 @@ REGEX;
|
|||
* @return string
|
||||
*/
|
||||
private function languageConvert( $text ) {
|
||||
$lang = $this->mParser->getTargetLanguage();
|
||||
$langConv = MediaWikiServices::getInstance()->getLanguageConverterFactory()
|
||||
->getLanguageConverter( $lang );
|
||||
$langConv = $this->mParser->getTargetLanguageConverter();
|
||||
if ( $langConv->hasVariants() && strpos( $text, '-{' ) !== false ) {
|
||||
$text = $langConv->convert( $text );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue