This change allows only language codes with translations for the user
option 'language'. This restrict the selectable values in the
preferences and also prevents setting the user option via API.
With the URL parameter 'uselang' the user interface language can
still set to a language code without translation.
In the current situation this change will remove the following language
codes from the allowed values:
> print '* ' . implode( "\n* ", array_diff(
array_keys( Language::fetchLanguageNames( null, 'mw' ) ),
array_keys( Language::fetchLanguageNames( null, 'mwfile' ) )
) );
* aa
* als
* bat-smg
* be-x-old
* cho
* fiu-vro
* ho
* hz
* kj
* kr
* mh
* mus
* ng
* no
* rn
* roa-rup
* shi-latn
* shi-tfng
* simple
* tum
* uz-cyrl
* uz-latn
* zh-classical
* zh-min-nan
* zh-yue
The change I1dd6fb1f240ce3319b132d0f29f0622fba33e655 ensures that the
deprecated language codes get replaced by the new language codes. The
other untranslated language codes get replaced by the content language
codes when the user loads the preferences.
Bug: T118199
Change-Id: I1382996b031af3fe9f6e1568beeb6376dcbcd217
}
// Language
- $languages = Language::fetchLanguageNames( null, 'mw' );
+ $languages = Language::fetchLanguageNames( null, 'mwfile' );
$languageCode = $this->config->get( 'LanguageCode' );
if ( !array_key_exists( $languageCode, $languages ) ) {
$languages[$languageCode] = $languageCode;