Fix ParserOptions so it uses correct language when transforming messages as reported...
authorChad Horohoe <demon@users.mediawiki.org>
Thu, 6 Jan 2011 18:22:24 +0000 (18:22 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Thu, 6 Jan 2011 18:22:24 +0000 (18:22 +0000)
config/index.php
includes/installer/CoreInstaller.php

index e394a04..95faba8 100644 (file)
@@ -39,6 +39,8 @@ function wfInstallerMain() {
        }
        $wgLang = Language::factory( $langCode );
 
+       $installer->setParserLanguage( $wgLang->getCode() );
+
        $wgMetaNamespace = $wgCanonicalNamespaceNames[NS_PROJECT];
 
        $session = $installer->execute( $session );
index b8380a3..e852760 100644 (file)
@@ -242,7 +242,7 @@ abstract class CoreInstaller extends Installer {
                }
 
                $this->parserTitle = Title::newFromText( 'Installer' );
-               $this->parserOptions = new ParserOptions;
+               $this->parserOptions = new ParserOptions; // language will  be wrong :(
                $this->parserOptions->setEditSection( false );
        }
 
@@ -258,6 +258,14 @@ abstract class CoreInstaller extends Installer {
                return true;
        }
 
+       /**
+        * ParserOptions are constructed before we determined the language, so fix it
+        */
+       public function setParserLanguage( $lang ) {
+               $this->parserOptions->setTargetLanguage( $lang );
+               $this->parserOptions->setUserLang( $lang );
+       }
+
        /**
         * Extension tag hook for a documentation link.
         */