Changed installation code so that wgContLanguageCode is set, replacing wgLanguageCode.
authorZheng Zhu <zhengzhu@users.mediawiki.org>
Fri, 24 Sep 2004 00:34:13 +0000 (00:34 +0000)
committerZheng Zhu <zhengzhu@users.mediawiki.org>
Fri, 24 Sep 2004 00:34:13 +0000 (00:34 +0000)
config/index.php
includes/Setup.php
languages/Language.php

index 6adbc3f..53e3064 100644 (file)
@@ -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" );
index 64cd601..8e19b3e 100644 (file)
@@ -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(); }
index a309218..19bfa19 100644 (file)
@@ -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' );
 
 }
 ?>