self revert r45512, r45513 and r45515 for now
authorRaimond Spekking <raymond@users.mediawiki.org>
Sat, 17 Jan 2009 08:56:27 +0000 (08:56 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Sat, 17 Jan 2009 08:56:27 +0000 (08:56 +0000)
Per Brions review on r45512. I need a bit more time to fix it.

docs/hooks.txt
includes/SkinTemplate.php
languages/Language.php
skins/Modern.php
skins/MonoBook.php

index 895ef1b..22db827 100644 (file)
@@ -790,10 +790,6 @@ $password: The password entered by the user
 &$result: Set this and return false to override the internal checks
 $user: User the password is being validated for
 
-'LanguageGetLocalizedLanguageNames': Use to get localized language names
-&$languageNames: localized language names (array)
-$lang: laguage code (string)
-
 'LanguageGetMagic': Use this to define synonyms of magic words depending of the language
 $magicExtensions: associative array of magic words synonyms
 $lang: laguage code (string)
index 7295a03..b774392 100644 (file)
@@ -416,13 +416,8 @@ class SkinTemplate extends Skin {
                                if ( $nt ) {
                                        $language_urls[] = array(
                                                'href' => $nt->getFullURL(),
-                                               'text' => ( $wgContLang->getLanguageName( $nt->getInterwiki() ) != ''
-                                                       ? $wgContLang->getLanguageName( $nt->getInterwiki() )
-                                                       : $l ),
-                                               'class' => $class,
-                                               'title' => ( $wgLang->getLanguageNameLocalized( $nt->getInterwiki() ) != ''
-                                                       ? $wgLang->getLanguageNameLocalized( $nt->getInterwiki() )
-                                                       : $l )
+                                               'text' => ($wgContLang->getLanguageName( $nt->getInterwiki()) != ''?$wgContLang->getLanguageName( $nt->getInterwiki()) : $l),
+                                               'class' => $class
                                        );
                                }
                        }
index dae3952..6502aa0 100644 (file)
@@ -55,7 +55,6 @@ class FakeConverter {
 class Language {
        var $mConverter, $mVariants, $mCode, $mLoaded = false;
        var $mMagicExtensions = array(), $mMagicHookDone = false;
-       var $mLocalizedLanguagesNames = null;
 
        static public $mLocalisationKeys = array(
                'fallback', 'namespaceNames', 'mathNames', 'bookstoreList',
@@ -410,19 +409,6 @@ class Language {
                return $names;
        }
 
-       /**
-        * Get localized language names
-        *
-        * @return array
-        */
-       function getLocalizedLanguageNames() {
-               if( !is_array( $this->mLocalizedLanguagesNames ) ) {
-                       $this->mLocalizedLanguagesNames = array();
-                       wfRunHooks( 'LanguageGetLocalizedLanguageNames', array( &$this->mLocalizedLanguagesNames, $this->getCode() ) );
-               }
-               return $this->mLocalizedLanguagesNames;
-       }
-
        /**
         * Get a message from the MediaWiki namespace.
         *
@@ -433,27 +419,12 @@ class Language {
                return wfMsgExt( $msg, array( 'parsemag', 'language' => $this ) );
        }
 
-       /**
-        * Get a language name
-        *
-        * @param $code String language code
-        * @return $localized boolean gets the localized language name
-        */
-       function getLanguageName( $code, $localized = false ) {
+       function getLanguageName( $code ) {
                $names = self::getLanguageNames();
                if ( !array_key_exists( $code, $names ) ) {
                        return '';
                }
-               if( $localized ) {
-                       $languageNames = $this->getLocalizedLanguageNames();
-                       return isset( $languageNames[$code] ) ? $languageNames[$code] : $names[$code];
-               } else {
-                       return $names[$code];
-               }
-       }
-
-       function getLanguageNameLocalized( $code ) {
-               return self::getLanguageName( $code, true );
+               return $names[$code];
        }
 
        function getMonthName( $key ) {
index 9a55ab4..c16ae47 100644 (file)
@@ -332,15 +332,9 @@ class ModernTemplate extends QuickTemplate {
                <h5><?php $this->msg('otherlanguages') ?></h5>
                <div class="pBody">
                        <ul>
-<?php          foreach($this->data['language_urls'] as $langlink) {
-                       // Add title tag only if differ from shown text
-                       $titleTag = $langlink['title'] == $langlink['text'] 
-                               ? ''
-                               : 'title="' . htmlspecialchars( $langlink['title'] ) . '"';
-                       ?>
+<?php          foreach($this->data['language_urls'] as $langlink) { ?>
                                <li class="<?php echo htmlspecialchars($langlink['class'])?>"><?php
-                               ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>"
-                               <? echo $titleTag ?> > <?php echo $langlink['text'] ?></a></li>
+                               ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>"><?php echo $langlink['text'] ?></a></li>
 <?php          } ?>
                        </ul>
                </div><!-- pBody -->
index f4724e4..62d98ba 100644 (file)
@@ -334,15 +334,9 @@ class MonoBookTemplate extends QuickTemplate {
                <h5><?php $this->msg('otherlanguages') ?></h5>
                <div class="pBody">
                        <ul>
-<?php          foreach($this->data['language_urls'] as $langlink) {
-                       // Add title tag only if differ from shown text
-                       $titleTag = $langlink['title'] == $langlink['text'] 
-                               ? ''
-                               : 'title="' . htmlspecialchars( $langlink['title'] ) . '"';
-                       ?>
+<?php          foreach($this->data['language_urls'] as $langlink) { ?>
                                <li class="<?php echo htmlspecialchars($langlink['class'])?>"><?php
-                               ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>"
-                               <? echo $titleTag ?> > <?php echo $langlink['text'] ?></a></li>
+                               ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>"><?php echo $langlink['text'] ?></a></li>
 <?php          } ?>
                        </ul>
                </div>