r79741 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79740‎ | r79741 | r79742 >
Date:18:22, 6 January 2011
Author:demon
Status:ok
Tags:
Comment:
Fix ParserOptions so it uses correct language when transforming messages as reported on translatewiki.net.
Modified paths:
  • /trunk/phase3/config/index.php (modified) (history)
  • /trunk/phase3/includes/installer/CoreInstaller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/CoreInstaller.php
@@ -242,7 +242,7 @@
243243 }
244244
245245 $this->parserTitle = Title::newFromText( 'Installer' );
246 - $this->parserOptions = new ParserOptions;
 246+ $this->parserOptions = new ParserOptions; // language will be wrong :(
247247 $this->parserOptions->setEditSection( false );
248248 }
249249
@@ -259,6 +259,14 @@
260260 }
261261
262262 /**
 263+ * ParserOptions are constructed before we determined the language, so fix it
 264+ */
 265+ public function setParserLanguage( $lang ) {
 266+ $this->parserOptions->setTargetLanguage( $lang );
 267+ $this->parserOptions->setUserLang( $lang );
 268+ }
 269+
 270+ /**
263271 * Extension tag hook for a documentation link.
264272 */
265273 public function docLink( $linkText, $attribs, $parser ) {
Index: trunk/phase3/config/index.php
@@ -39,6 +39,8 @@
4040 }
4141 $wgLang = Language::factory( $langCode );
4242
 43+ $installer->setParserLanguage( $wgLang->getCode() );
 44+
4345 $wgMetaNamespace = $wgCanonicalNamespaceNames[NS_PROJECT];
4446
4547 $session = $installer->execute( $session );

Follow-up revisions

RevisionCommit summaryAuthorDate
r80080Fix for r79741, setTargetLanguage and setUserLang want an object and string, ...demon08:53, 12 January 2011
r801901.17: MFT first batch of installer changes: r78043, r78231, r78259, r78300, r...catrope20:47, 13 January 2011

Status & tagging log