if ( !$wgDisableLangConversion ) {
$variants = $wgContLang->getVariants();
- $languages = Language::getLanguageNames( true );
foreach ( $variants as $v ) {
$v = str_replace( '_', '-', strtolower( $v ) );
- if ( array_key_exists( $v, $languages ) ) {
- // If it doesn't have a name, we'll pretend it doesn't exist
- $variantArray[$v] = $languages[$v];
- }
+ $variantArray[$v] = $wgContLang->getVariantname( $v, false );
}
$options = array();
'type' => 'select',
'options' => $options,
'section' => 'personal/i18n',
+ 'help-message' => 'prefs-help-variant',
);
}
}
/**
* @param $user User
- * @param $context RequestContext
+ * @param $context IContextSource
* @param $formClass string
* @return HtmlForm
*/
- static function getFormObject( $user, RequestContext $context, $formClass = 'PreferencesForm' ) {
+ static function getFormObject( $user, IContextSource $context, $formClass = 'PreferencesForm' ) {
$formDescriptor = Preferences::getPreferences( $user );
$htmlForm = new $formClass( $formDescriptor, $context, 'prefs' );