From 70cc1d68d56dcc8b0611434539eed8189e2b445f Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Wed, 25 May 2005 04:09:33 +0000 Subject: [PATCH] * Using $wgLang->getLanguageNames() rather than getting the language names directly by including languages/Names.php --- includes/SpecialPreferences.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index f34d8e59a7..a689052f40 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -8,9 +8,6 @@ if( !defined( 'MEDIAWIKI' ) ) die(); -/** to get a list of languages in setting user's language preference */ -require_once('languages/Names.php'); - /** * Entry point that create the "Preferences" object */ @@ -383,7 +380,7 @@ class PreferencesForm { function mainPrefsForm( $err ) { global $wgUser, $wgOut, $wgLang, $wgContLang, $wgValidSkinNames; global $wgAllowRealName, $wgImageLimits, $wgThumbLimits; - global $wgLanguageNames, $wgDisableLangConversion; + global $wgDisableLangConversion; global $wgEnotifWatchlist, $wgEnotifUserTalk,$wgEnotifMinorEdits; global $wgRCShowWatchingUsers, $wgEnotifRevealEditorAddress; global $wgEnableEmail, $wgEnableUserEmail, $wgEmailAuthentication; @@ -490,9 +487,10 @@ class PreferencesForm { * Otherwise, no default is selected and the user ends up * with an Afrikaans interface since it's first in the list. */ - $selectedLang = isset( $wgLanguageNames[$this->mUserLanguage] ) ? $this->mUserLanguage : $wgContLanguageCode; + $languages = $wgLang->getLanguageNames(); + $selectedLang = isset( $languages[$this->mUserLanguage] ) ? $this->mUserLanguage : $wgContLanguageCode; $selbox = null; - foreach($wgLanguageNames as $code => $name) { + foreach($languages as $code => $name) { global $IP; /* only add languages that have a file */ $langfile="$IP/languages/Language".str_replace('-', '_', ucfirst($code)).".php"; @@ -509,7 +507,7 @@ class PreferencesForm { foreach($variants as $v) { $v = str_replace( '_', '-', strtolower($v)); - if($name = $wgLanguageNames[$v]) { + if($name = $languages[$v]) { $variantArray[$v] = $name; } } -- 2.20.1