17 parent::__construct( $params );
19 if ( $this->mParent instanceof
HTMLForm ) {
20 $config = $this->mParent->getConfig();
21 $languageCode = $config->get(
'LanguageCode' );
27 $languages = MediaWikiServices::getInstance()
28 ->getLanguageNameUtils()
29 ->getLanguageNames(
null,
'mw' );
33 if ( !array_key_exists( $languageCode, $languages ) ) {
34 $languages[$languageCode] = $languageCode;
39 foreach ( $languages as $code => $name ) {
40 $this->mParams[
'options'][$code .
' - ' . $name] = $code;
43 if ( !array_key_exists(
'default', $params ) ) {
44 $this->mParams[
'default'] = $languageCode;