Per Nikerabbit and Siebrand: removed $skinNames from localisation files and replaced...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 25 Dec 2008 18:00:26 +0000 (18:00 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 25 Dec 2008 18:00:26 +0000 (18:00 +0000)
Updates for other languages should come soon :)

includes/specials/SpecialPreferences.php
languages/Language.php
languages/messages/MessagesEn.php
maintenance/language/checkLanguage.inc
maintenance/language/languages.inc
maintenance/language/messages.inc

index ab50486..ca2236e 100644 (file)
@@ -552,7 +552,6 @@ class PreferencesForm {
                }
 
                $qbs = $wgLang->getQuickbarSettings();
-               $skinNames = $wgLang->getSkinNames();
                $mathopts = $wgLang->getMathNames();
                $dateopts = $wgLang->getDatePreferences();
                $togs = User::getToggles();
@@ -834,23 +833,25 @@ class PreferencesForm {
                #
                global $wgAllowUserSkin;
                if( $wgAllowUserSkin ) {
-                       $wgOut->addHTML( "<fieldset>\n<legend>\n" . wfMsg('skin') . "</legend>\n" );
+                       $wgOut->addHTML( "<fieldset>\n<legend>\n" . wfMsg( 'skin' ) . "</legend>\n" );
                        $mptitle = Title::newMainPage();
-                       $previewtext = wfMsg('skin-preview');
+                       $previewtext = wfMsg( 'skin-preview' );
                        # Only show members of Skin::getSkinNames() rather than
                        # $skinNames (skins is all skin names from Language.php)
                        $validSkinNames = Skin::getUsableSkins();
                        # Sort by UI skin name. First though need to update validSkinNames as sometimes
                        # the skinkey & UI skinname differ (e.g. "standard" skinkey is "Classic" in the UI).
-                       foreach ($validSkinNames as $skinkey => & $skinname ) {
-                               if ( isset( $skinNames[$skinkey] ) )  {
-                                       $skinname = $skinNames[$skinkey];
+                       foreach ( $validSkinNames as $skinkey => &$skinname ) {
+                               $msgName = "skinname-{$skinkey}";
+                               $localisedSkinName = wfMsg( $msgName );
+                               if ( !wfEmptyMsg( $msgName, $localisedSkinName ) )  {
+                                       $skinname = $localisedSkinName;
                                }
                        }
                        asort($validSkinNames);
                        foreach ($validSkinNames as $skinkey => $sn ) {
                                $checked = $skinkey == $this->mSkin ? ' checked="checked"' : '';
-                               $mplink = htmlspecialchars($mptitle->getLocalURL("useskin=$skinkey"));
+                               $mplink = htmlspecialchars( $mptitle->getLocalURL( "useskin=$skinkey" ) );
                                $previewlink = "(<a target='_blank' href=\"$mplink\">$previewtext</a>)";
                                if( $skinkey == $wgDefaultSkin )
                                        $sn .= ' (' . wfMsg( 'default' ) . ')';
index 1e62668..26554be 100644 (file)
@@ -56,9 +56,9 @@ class Language {
        var $mConverter, $mVariants, $mCode, $mLoaded = false;
        var $mMagicExtensions = array(), $mMagicHookDone = false;
 
-       static public $mLocalisationKeys = array( 'fallback', 'namespaceNames',
-               'skinNames', 'mathNames',
-               'bookstoreList', 'magicWords', 'messages', 'rtl', 'digitTransformTable',
+       static public $mLocalisationKeys = array(
+               'fallback', 'namespaceNames', 'mathNames', 'bookstoreList',
+               'magicWords', 'messages', 'rtl', 'digitTransformTable',
                'separatorTransformTable', 'fallback8bitEncoding', 'linkPrefixExtension',
                'defaultUserOptionOverrides', 'linkTrail', 'namespaceAliases',
                'dateFormats', 'datePreferences', 'datePreferenceMigrationMap',
@@ -320,7 +320,7 @@ class Language {
                if ( isset( $aliases[$name][0] ) ) {
                        $name = $aliases[$name][0];
                }
-               return $this->getNsText(NS_SPECIAL) . ':' . $name;
+               return $this->getNsText( NS_SPECIAL ) . ':' . $name;
        }
 
        function getQuickbarSettings() {
@@ -333,11 +333,6 @@ class Language {
                );
        }
 
-       function getSkinNames() {
-               $this->load();
-               return $this->skinNames;
-       }
-
        function getMathNames() {
                $this->load();
                return $this->mathNames;
index f6148c2..0772c3c 100644 (file)
@@ -103,20 +103,6 @@ $namespaceNames = array(
  */
 $namespaceAliases = array();
 
-/**
- * Skin names. If any key is not specified, the English one will be used.
- */
-$skinNames = array(
-       'standard'    => 'Classic',
-       'nostalgia'   => 'Nostalgia',
-       'cologneblue' => 'Cologne Blue',
-       'monobook'    => 'MonoBook',
-       'myskin'      => 'MySkin',
-       'chick'       => 'Chick',
-       'simple'      => 'Simple',
-       'modern'      => 'Modern',
-);
-
 /**
  * Deprecated, use the message array
  */
@@ -3019,6 +3005,16 @@ This is probably caused by a link to a blacklisted external site.',
 'numauthors'     => 'Number of distinct authors (page): $1',
 'numtalkauthors' => 'Number of distinct authors (discussion page): $1',
 
+# Skins names
+'skinname-standard'    => 'Classic',
+'skinname-nostalgia'   => 'Nostalgia',
+'skinname-cologneblue' => 'Cologne Blue',
+'skinname-monobook'    => 'MonoBook',
+'skinname-myskin'      => 'MySkin',
+'skinname-chick'       => 'Chick',
+'skinname-simple'      => 'Simple',
+'skinname-modern'      => 'Modern',
+
 # Math options
 'mw_math_png'    => 'Always render PNG',
 'mw_math_simple' => 'HTML if very simple or else PNG',
index c0d699c..889d702 100644 (file)
@@ -74,7 +74,7 @@ class CheckLanguageCLI {
                return array(
                        'untranslated', 'duplicate', 'obsolete', 'variables', 'empty', 'plural',
                        'whitespace', 'xhtml', 'chars', 'links', 'unbalanced', 'namespace',
-                       'projecttalk', 'skin', 'magic', 'magic-old', 'magic-over', 'magic-case',
+                       'projecttalk', 'magic', 'magic-old', 'magic-over', 'magic-case',
                        'special', 'special-old',
                );
        }
@@ -85,7 +85,7 @@ class CheckLanguageCLI {
         */
        protected function nonMessageChecks() {
                return array(
-                       'namespace', 'projecttalk', 'skin', 'magic', 'magic-old', 'magic-over',
+                       'namespace', 'projecttalk', 'magic', 'magic-old', 'magic-over',
                        'magic-case', 'special', 'special-old',
                );
        }
@@ -120,7 +120,6 @@ class CheckLanguageCLI {
                        'unbalanced'   => 'getMessagesWithUnbalanced',
                        'namespace'    => 'getUntranslatedNamespaces',
                        'projecttalk'  => 'getProblematicProjectTalks',
-                       'skin'         => 'getUntranslatedSkins',
                        'magic'        => 'getUntranslatedMagicWords',
                        'magic-old'    => 'getObsoleteMagicWords',
                        'magic-over'   => 'getOverridingMagicWords',
@@ -140,7 +139,6 @@ class CheckLanguageCLI {
                return array(
                        'namespace'    => array( 'getNamespaceNames', 'en' ),
                        'projecttalk'  => null,
-                       'skin'         => array( 'getSkinNames', 'en' ),
                        'magic'        => array( 'getMagicWords', 'en' ),
                        'magic-old'    => array( 'getMagicWords', null ),
                        'magic-over'   => array( 'getMagicWords', null ),
@@ -169,7 +167,6 @@ class CheckLanguageCLI {
                        'unbalanced'   => '$1 message(s) of $2 in $3 have unbalanced {[]}:',
                        'namespace'    => '$1 namespace name(s) of $2 are not translated to $3, but exist in en:',
                        'projecttalk'  => '$1 namespace name(s) and alias(es) in $3 are project talk namespaces without the parameter:',
-                       'skin'         => '$1 skin name(s) of $2 are not translated to $3, but exist in en:',
                        'magic'        => '$1 magic word(s) of $2 are not translated to $3, but exist in en:',
                        'magic-old'    => '$1 magic word(s) of $2 do not exist in en, but exist in $3:',
                        'magic-over'   => '$1 magic word(s) of $2 in $3 do not contain the original en word(s):',
@@ -211,7 +208,6 @@ Check codes (ideally, all of them should result 0; all the checks are executed b
        * unbalanced: Messages which contains unequal numbers of opening {[ and closing ]}.
        * namespace: Namespace names that were not translated.
        * projecttalk: Namespace names and aliases where the project talk does not contain $1.
-       * skin: Skin names that were not translated.
        * magic: Magic words that were not translated.
        * magic-old: Magic words which do not exist.
        * magic-over: Magic words that override the original English word.
index 9aecb4c..61ad287 100644 (file)
@@ -20,7 +20,6 @@ class languages {
 
        protected $mNamespaceNames; # Namespace names
        protected $mNamespaceAliases; # Namespace aliases
-       protected $mSkinNames; # Skin names
        protected $mMagicWords; # Magic words
        protected $mSpecialPageAliases; # Special page aliases
 
@@ -79,7 +78,6 @@ class languages {
                if ( isset( $this->mRawMessages[$code] ) &&
                        isset( $this->mNamespaceNames[$code] ) &&
                        isset( $this->mNamespaceAliases[$code] ) &&
-                       isset( $this->mSkinNames[$code] ) &&
                        isset( $this->mMagicWords[$code] ) &&
                        isset( $this->mSpecialPageAliases[$code] ) ) {
                        return;
@@ -87,7 +85,6 @@ class languages {
                $this->mRawMessages[$code] = array();
                $this->mNamespaceNames[$code] = array();
                $this->mNamespaceAliases[$code] = array();
-               $this->mSkinNames[$code] = array();
                $this->mMagicWords[$code] = array();
                $this->mSpecialPageAliases[$code] = array();
                $filename = Language::getMessagesFileName( $code );
@@ -102,9 +99,6 @@ class languages {
                        if ( isset( $namespaceAliases ) ) {
                                $this->mNamespaceAliases[$code] = $namespaceAliases;
                        }
-                       if ( isset( $skinNames ) ) {
-                               $this->mSkinNames[$code] = $skinNames;
-                       }
                        if ( isset( $magicWords ) ) {
                                $this->mMagicWords[$code] = $magicWords;
                        }
@@ -236,18 +230,6 @@ class languages {
                return $this->mNamespaceAliases[$code];
        }
 
-       /**
-        * Get skin names for a specific language.
-        *
-        * @param $code The language code.
-        *
-        * @return Skin names.
-        */
-       public function getSkinNames( $code ) {
-               $this->loadFile( $code );
-               return $this->mSkinNames[$code];
-       }
-
        /**
         * Get magic words for a specific language.
         *
@@ -575,19 +557,6 @@ class languages {
                return $namespaces;
        }
 
-       /**
-        * Get the untranslated skin names.
-        *
-        * @param $code The language code.
-        *
-        * @return The untranslated skin names in this language.
-        */
-       public function getUntranslatedSkins( $code ) {
-               $this->loadFile( 'en' );
-               $this->loadFile( $code );
-               return array_diff_key( $this->mSkinNames['en'], $this->mSkinNames[$code] );
-       }
-
        /**
         * Get the untranslated magic words.
         *
index 7ac430c..03a1e72 100644 (file)
@@ -2164,6 +2164,16 @@ $wgMessageStructure = array(
                'numauthors',
                'numtalkauthors',
        ),
+       'skin' => array(
+               'skinname-standard',
+               'skinname-nostalgia',
+               'skinname-cologneblue',
+               'skinname-monobook',
+               'skinname-myskin',
+               'skinname-chick',
+               'skinname-simple',
+               'skinname-modern',
+       ),
        'math' => array(
                'mw_math_png',
                'mw_math_simple',
@@ -2972,6 +2982,7 @@ XHTML id names.",
        'attribution'         => 'Attribution',
        'spamprotection'      => 'Spam protection',
        'info'                => 'Info page',
+       'skin'                => 'Skins names',
        'math'                => 'Math options',
        'patrolling'          => 'Patrolling',
        'patrol-log'          => 'Patrol log',