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',
);
}
}
// show a preview of the old signature first
$oldsigWikiText = $wgParser->preSaveTransform( "~~~", new Title, $user, new ParserOptions );
- $oldsigHTML = $wgOut->parseInline( $oldsigWikiText );
+ $oldsigHTML = $wgOut->parseInline( $oldsigWikiText, true, true );
$defaultPreferences['oldsig'] = array(
'type' => 'info',
'raw' => true,
/**
* @param $user User
+ * @param $context IContextSource
* @param $formClass string
* @return HtmlForm
*/
- static function getFormObject( $user, $formClass = 'PreferencesForm' ) {
+ static function getFormObject( $user, IContextSource $context, $formClass = 'PreferencesForm' ) {
$formDescriptor = Preferences::getPreferences( $user );
- $htmlForm = new $formClass( $formDescriptor, 'prefs' );
+ $htmlForm = new $formClass( $formDescriptor, $context, 'prefs' );
$htmlForm->setId( 'mw-prefs-form' );
$htmlForm->setSubmitText( wfMsg( 'saveprefs' ) );
* Get the whole body of the form.
*/
function getBody() {
- return $this->displaySection( $this->mFieldTree, '', true );
+ return $this->displaySection( $this->mFieldTree, '', 'mw-prefsection-' );
}
}