From 802bdecbebf9c89e429b03b09764c8241831138c Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Sat, 17 Jan 2009 08:56:27 +0000 Subject: [PATCH] self revert r45512, r45513 and r45515 for now Per Brions review on r45512. I need a bit more time to fix it. --- docs/hooks.txt | 4 ---- includes/SkinTemplate.php | 9 ++------- languages/Language.php | 33 ++------------------------------- skins/Modern.php | 10 ++-------- skins/MonoBook.php | 10 ++-------- 5 files changed, 8 insertions(+), 58 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 895ef1be8f..22db827691 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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) diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 7295a03446..b7743925f0 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -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 ); } } diff --git a/languages/Language.php b/languages/Language.php index dae3952e33..6502aa0d4f 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -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 ) { diff --git a/skins/Modern.php b/skins/Modern.php index 9a55ab45c0..c16ae47668 100644 --- a/skins/Modern.php +++ b/skins/Modern.php @@ -332,15 +332,9 @@ class ModernTemplate extends QuickTemplate {
msg('otherlanguages') ?>
diff --git a/skins/MonoBook.php b/skins/MonoBook.php index f4724e4308..62d98baa7c 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -334,15 +334,9 @@ class MonoBookTemplate extends QuickTemplate {
msg('otherlanguages') ?>
-- 2.20.1