Add support for Number grouping(commafy) based on CLDR number grouping patterns like...
[lhc/web/wiklou.git] / includes / Preferences.php
index c999a2e..a955b6f 100644 (file)
@@ -276,13 +276,9 @@ class Preferences {
                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();
@@ -297,6 +293,7 @@ class Preferences {
                                        'type' => 'select',
                                        'options' => $options,
                                        'section' => 'personal/i18n',
+                                       'help-message' => 'prefs-help-variant',
                                );
                        }
                }
@@ -1215,11 +1212,11 @@ class Preferences {
 
        /**
         * @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' );