From: Zheng Zhu Date: Fri, 24 Sep 2004 00:34:13 +0000 (+0000) Subject: Changed installation code so that wgContLanguageCode is set, replacing wgLanguageCode. X-Git-Tag: 1.5.0alpha1~1834 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=6d10e85a523115ad6e6a2024c2c0aadb78df8159;p=lhc%2Fweb%2Fwiklou.git Changed installation code so that wgContLanguageCode is set, replacing wgLanguageCode. --- diff --git a/config/index.php b/config/index.php index 6adbc3fb3d..53e3064117 100644 --- a/config/index.php +++ b/config/index.php @@ -885,7 +885,7 @@ if ( \$wgCommandLineMode ) { \$wgLocalInterwiki = \$wgSitename; -\$wgLanguageCode = \"{$slconf['LanguageCode']}\"; +\$wgContLanguageCode = \"{$slconf['LanguageCode']}\"; \$wgUseLatin1 = " . ($conf->Latin1 ? 'true' : 'false') . ";\n \$wgProxyKey = \"$proxyKey\"; @@ -968,7 +968,7 @@ function aField( &$conf, $field, $text, $type = "", $value = "" ) { function getLanguageList() { global $wgLanguageNames; if( !isset( $wgLanguageNames ) ) { - $wgLanguageCode = "xxx"; + $wgContLanguageCode = "xxx"; function wfLocalUrl( $x ) { return $x; } function wfLocalUrlE( $x ) { return $x; } require_once( "../languages/Names.php" ); diff --git a/includes/Setup.php b/includes/Setup.php index 64cd60102a..8e19b3e6d1 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -235,7 +235,7 @@ if( count( $wgUserLanguages ) && wfProfileOut( $fname.'-User' ); wfProfileIn( $fname.'-language' ); -function setupLangObj($langclass, $langcode) { +function setupLangObj(&$langclass, $langcode) { global $wgUseLatin1; @@ -260,13 +260,12 @@ function setupLangObj($langclass, $langcode) { return $lang; } -/* TODO: change the installation script so that - wgContLanguageCode is set there instead of here -*/ require_once( 'languages/Language.php' ); -$wgContLanguageCode = $wgLanguageCode; + $wgContLangClass = 'Language' . str_replace( '-', '_', ucfirst( $wgContLanguageCode ) ); + $wgContLang = setupLangObj($wgContLangClass, $wgContLangClass); + $n = get_class($wgContLang); // set default user option from content language if(!$wgUser->mDataLoaded) { $wgUser->loadDefaultFromLanguage(); } diff --git a/languages/Language.php b/languages/Language.php index a30921816e..19bfa191be 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -2047,7 +2047,7 @@ class Language { } # This should fail gracefully if there's not a localization available -@include_once( 'Language' . str_replace( '-', '_', ucfirst( $wgLanguageCode ) ) . '.php' ); +@include_once( 'Language' . str_replace( '-', '_', ucfirst( $wgContLanguageCode ) ) . '.php' ); } ?>