r101132 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101131‎ | r101132 | r101133 >
Date:13:55, 28 October 2011
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
New accept queue message task, when you just want to click, click and click
Also disabled the review task which is not useful
Internationalization/#147
Modified paths:
  • /trunk/extensions/Translate/Translate.i18n.php (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/TranslateTasks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/Translate.php
@@ -320,7 +320,8 @@
321321 'optional' => 'ViewOptionalTask',
322322 'suggestions' => 'ViewWithSuggestionsTask',
323323 // 'untranslatedoptional' => 'ViewUntranslatedOptionalTask',
324 - 'review' => 'ReviewMessagesTask',
 324+// 'review' => 'ReviewMessagesTask',
 325+ 'acceptqueue' => 'AcceptQueueMessagesTask',
325326 'reviewall' => 'ReviewAllMessagesTask',
326327 'export-as-po' => 'ExportasPoMessagesTask',
327328 'export-to-file' => 'ExportToFileMessagesTask',
Index: trunk/extensions/Translate/TranslateTasks.php
@@ -196,7 +196,7 @@
197197 }
198198
199199 /**
200 - * List messages which has been changed since last export.
 200+ * Basic class for review mode
201201 */
202202 class ReviewMessagesTask extends ViewMessagesTask {
203203 protected $id = 'review';
@@ -207,15 +207,12 @@
208208 $this->collection->setReviewMode( true );
209209 $this->collection->setInfile( $this->group->load( $code ) );
210210 $this->collection->filter( 'ignored' );
211 - $this->collection->filter( 'hastranslation', false );
212 - $this->collection->filter( 'changed', false );
213211 }
214212
215213 protected function output() {
216214 $table = new MessageTable( $this->collection, $this->group );
217215 $table->appendEditLinkParams( 'loadtask', $this->getId() );
218216 $table->setReviewMode();
219 -
220217 return $table->fullTable();
221218 }
222219 }
@@ -327,15 +324,27 @@
328325 protected $id = 'reviewall';
329326
330327 protected function preinit() {
331 - $code = $this->options->getLanguage();
332 - $this->collection = $this->group->initCollection( $code );
333 - $this->collection->setReviewMode( true );
334 - $this->collection->setInfile( $this->group->load( $code ) );
 328+ parent::preinit();
335329 $this->collection->filter( 'ignored' );
336330 $this->collection->filter( 'hastranslation', false );
337331 }
338332 }
339333
 334+/// Lists all translations for accepting.
 335+class AcceptQueueMessagesTask extends ReviewMessagesTask {
 336+ protected $id = 'acceptqueue';
 337+
 338+ protected function preinit() {
 339+ global $wgUser;
 340+ parent::preinit();
 341+ $this->collection->filter( 'ignored' );
 342+ $this->collection->filter( 'hastranslation', false );
 343+ $this->collection->filter( 'fuzzy' );
 344+ $this->collection->filter( 'reviewer', true, $wgUser->getId() );
 345+ $this->collection->filter( 'last-translator', true, $wgUser->getId() );
 346+ }
 347+}
 348+
340349 /**
341350 * Exports messages to their native format with embedded textarea.
342351 */
@@ -453,7 +462,6 @@
454463 $filterTasks = array(
455464 'optional',
456465 'untranslatedoptional',
457 - 'review',
458466 'export-to-file',
459467 );
460468
Index: trunk/extensions/Translate/Translate.i18n.php
@@ -30,6 +30,7 @@
3131 'translate-task-untranslatedoptional' => 'View untranslated optional messages from',
3232 'translate-task-problematic' => 'View messages that have problems',
3333 'translate-task-review' => 'Review changes to',
 34+ 'translate-task-acceptqueue' => 'Accept translations in',
3435 'translate-task-reviewall' => 'Review all translated messages in',
3536 'translate-task-export' => 'Export translations',
3637 'translate-task-export-to-file' => 'Export translations to file',

Comments

#Comment by Siebrand (talk | contribs)   14:54, 28 October 2011

Message for the review task should also be removed?

#Comment by Nikerabbit (talk | contribs)   16:28, 28 October 2011

There are messages for other not enabled by default tasks too. Maybe something to look at when there is extra time.

Status & tagging log