18 parent::__construct( $params );
20 if ( $this->mParent instanceof
HTMLForm ) {
21 $config = $this->mParent->getConfig();
22 $languageCode = $config->get( MainConfigNames::LanguageCode );
24 $languageCode = MediaWikiServices::getInstance()->getMainConfig()->get(
25 MainConfigNames::LanguageCode );
28 $languages = MediaWikiServices::getInstance()
29 ->getLanguageNameUtils()
34 if ( !array_key_exists( $languageCode, $languages ) ) {
35 $languages[$languageCode] = $languageCode;
40 foreach ( $languages as $code => $name ) {
41 $this->mParams[
'options'][$code .
' - ' . $name] = $code;
44 if ( !array_key_exists(
'default', $params ) ) {
45 $this->mParams[
'default'] = $languageCode;