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