r112878 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112877‎ | r112878 | r112879 >
Date:12:05, 2 March 2012
Author:siebrand
Status:ok (Comments)
Tags:i18nreview 
Comment:
Logging for encouraged/discouraged marking to Special:Log/pagetranslation on Special:PageTranslation.

Card i18n/#382
Modified paths:
  • /trunk/extensions/Translate/PageTranslation.i18n.php (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/TranslateHooks.php (modified) (history)
  • /trunk/extensions/Translate/tag/PageTranslationHooks.php (modified) (history)
  • /trunk/extensions/Translate/tag/SpecialPageTranslation.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php
@@ -83,11 +83,16 @@
8484 'tgr_state' => 'discouraged',
8585 );
8686
 87+ $logger = new LogPage( 'pagetranslation' );
 88+ $params = array( 'user' => $wgUser->getName() );
 89+
8790 if ( $action === 'encourage' ) {
8891 $dbw->delete( $table, $row, __METHOD__ );
 92+ $logger->addEntry( 'encourage', $page->getTitle(), null, array( serialize( $params ) ) );
8993 } else {
9094 $index = array( 'tgr_group', 'tgr_lang' );
9195 $dbw->replace( $table, array( $index ), $row, __METHOD__ );
 96+ $logger->addEntry( 'discourage', $page->getTitle(), null, array( serialize( $params ) ) );
9297 }
9398
9499 $this->listPages();
@@ -315,7 +320,6 @@
316321 }
317322 $out->addHtml( '</ol>' );
318323 }
319 -
320324 }
321325
322326 /**
Index: trunk/extensions/Translate/tag/PageTranslationHooks.php
@@ -608,6 +608,10 @@
609609 return wfMsgExt( 'pt-log-delete-full-ok', $opts, $title->getPrefixedText(), $user );
610610 } elseif ( $action === 'deletelok' ) {
611611 return wfMsgExt( 'pt-log-delete-lang-ok', $opts, $title->getPrefixedText(), $user );
 612+ } elseif ( $action === 'encourage' ) {
 613+ return wfMsgExt( 'pt-log-encourage', $opts, $title->getPrefixedText(), $user );
 614+ } elseif ( $action === 'discourage' ) {
 615+ return wfMsgExt( 'pt-log-discourage', $opts, $title->getPrefixedText(), $user );
612616 } elseif ( $action === 'prioritylanguages' ) {
613617 if ( $_['languages'] === false ) {
614618 return wfMsgExt( 'pt-log-priority-langs-unset', $opts, $title->getPrefixedText(), $user );
Index: trunk/extensions/Translate/Translate.php
@@ -15,7 +15,7 @@
1616 /**
1717 * Version number used in extension credits and in other placed where needed.
1818 */
19 -define( 'TRANSLATE_VERSION', '2012-02-26' );
 19+define( 'TRANSLATE_VERSION', '2012-03-02' );
2020
2121 /**
2222 * Extension credits properties.
Index: trunk/extensions/Translate/TranslateHooks.php
@@ -67,6 +67,8 @@
6868 $wgLogActionsHandlers['pagetranslation/deletefok'] = 'PageTranslationHooks::formatLogEntry';
6969 $wgLogActionsHandlers['pagetranslation/deletelnok'] = 'PageTranslationHooks::formatLogEntry';
7070 $wgLogActionsHandlers['pagetranslation/deletefnok'] = 'PageTranslationHooks::formatLogEntry';
 71+ $wgLogActionsHandlers['pagetranslation/encourage'] = 'PageTranslationHooks::formatLogEntry';
 72+ $wgLogActionsHandlers['pagetranslation/discourage'] = 'PageTranslationHooks::formatLogEntry';
7173 $wgLogActionsHandlers['pagetranslation/prioritylanguages'] = 'PageTranslationHooks::formatLogEntry';
7274
7375 global $wgJobClasses;
Index: trunk/extensions/Translate/PageTranslation.i18n.php
@@ -134,11 +134,12 @@
135135 'pt-log-delete-full-nok' => '{{GENDER:$2|encountered}} a problem while deleting translatable page [[:$1]]',
136136 'pt-log-delete-lang-ok' => '{{GENDER:$2|completed}} deletion of translation page $1',
137137 'pt-log-delete-lang-nok' => '{{GENDER:$2|encountered}} a problem while deleting translation page [[:$1]]',
 138+ 'pt-log-encourage' => '{{GENDER:$2|encouraged}} translation for page [[:$1]]',
 139+ 'pt-log-discourage' => '{{GENDER:$2|discouraged}} translation for page [[:$1]]',
138140 'pt-log-priority-langs-unset' => '{{GENDER:$2|removed}} priority languages from translatable page [[:$1]]',
139141 'pt-log-priority-langs' => '{{GENDER:$2|set}} the priority languages for translatable page [[:$1]] to $3',
140142 'pt-log-priority-langs-force' => '{{GENDER:$2|limited}} languages for translatable page [[:$1]] to $3',
141143
142 -
143144 # move page replacement
144145 'pt-movepage-title' => 'Move translatable page $1',
145146 'pt-movepage-blockers' => 'The translatable page cannot be moved to a new name because of the following {{PLURAL:$1|error|errors}}:',

Follow-up revisions

RevisionCommit summaryAuthorDate
r112882* Follow-up r112878: Fix bad copy-paste....siebrand12:30, 2 March 2012
r112901Address Niklas' comment on r112878. s/for/of. Not adding "translatable". IMO ...siebrand16:46, 2 March 2012

Comments

#Comment by Nikerabbit (talk | contribs)   16:02, 2 March 2012

"of page" sounds more natural to me than "for page". I would also use translatable page for consistency in terminology.

#Comment by Siebrand (talk | contribs)   16:46, 2 March 2012

Status & tagging log