r108386 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108385‎ | r108386 | r108387 >
Date:08:38, 9 January 2012
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
* Avoid double parsing of the description
* Use FuzzyBot to create the pages, isntead of a random user
* Read the page contents for the definition if the page exists
* Add the configuration global for dependency for message group cache
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/MessageGroups.php
@@ -999,7 +999,7 @@
10001000 }
10011001
10021002 public function getDescription() {
1003 - return wfMessage( 'translate-workflowgroup-desc' )->text();
 1003+ return wfMessage( 'translate-workflowgroup-desc' )->plain();
10041004 }
10051005
10061006 public function getDefinitions() {
@@ -1009,19 +1009,23 @@
10101010
10111011 foreach ( array_keys( $wgTranslateWorkflowStates ) as $state ) {
10121012 $titleString = "Translate-workflow-state-$state";
 1013+ $definitionText = $state;
10131014
10141015 // Automatically create pages for workflow states in the original language
10151016 $title = Title::makeTitle( $this->getNamespace(), $titleString );
10161017 if ( !$title->exists() ) {
10171018 $page = new WikiPage( $title );
10181019 $page->doEdit(
1019 - $state,
 1020+ $state /*content*/,
10201021 wfMessage( 'translate-workflow-autocreated-summary', $state )->inContentLanguage()->text(),
1021 - EDIT_NEW
 1022+ 0, /*flags*/
 1023+ false, /* base revision id */
 1024+ FuzzyBot::getUser()
10221025 );
 1026+ } else {
 1027+ $definitionText = Revision::newFromTitle( $title )->getText();
10231028 }
1024 -
1025 - $defs[$titleString] = $state;
 1029+ $defs[$titleString] = $definitionText;
10261030 }
10271031
10281032 return $defs;
@@ -1107,6 +1111,7 @@
11081112 $deps[] = new GlobalDependency( 'wgTranslateEC' );
11091113 $deps[] = new GlobalDependency( 'wgTranslateCC' );
11101114 $deps[] = new GlobalDependency( 'wgTranslateExtensionDirectory' );
 1115+ $deps[] = new GlobalDependency( 'wgTranslateWorkflowStates' );
11111116 $deps[] = new FileDependency( dirname( __FILE__ ) . '/groups/mediawiki-defines.txt' );
11121117 $deps[] = new FileDependency( dirname( __FILE__ ) . '/groups/Wikia/extensions.txt' );
11131118 $deps[] = new FileDependency( dirname( __FILE__ ) . '/groups/Toolserver/toolserver-textdomains.txt' );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108333Automatic creation of workflow states.amire8022:57, 7 January 2012

Comments

#Comment by Nikerabbit (talk | contribs)   08:42, 9 January 2012

Was followup to r108333.

Status & tagging log