Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php |
— | — | @@ -59,6 +59,10 @@ |
60 | 60 | if ( $revision === -1 ) { |
61 | 61 | $page = TranslatablePage::newFromTitle( $title ); |
62 | 62 | $page->removeTags(); |
| 63 | + global $wgUser; |
| 64 | + $logger = new LogPage( 'pagetranslation' ); |
| 65 | + $params = array( 'user' => $wgUser->getName() ); |
| 66 | + $logger->addEntry( 'unmark', $page->getTitle(), null, array( serialize( $params ) ) ); |
63 | 67 | $wgOut->addWikiMsg( 'tpt-unmarked', $title->getPrefixedText() ); |
64 | 68 | |
65 | 69 | return; |
— | — | @@ -484,6 +488,15 @@ |
485 | 489 | $page->addMarkedTag( $newrevision, $changed ); |
486 | 490 | $this->addFuzzyTags( $page, $changed ); |
487 | 491 | |
| 492 | + global $wgUser; |
| 493 | + $logger = new LogPage( 'pagetranslation' ); |
| 494 | + $params = array( |
| 495 | + 'user' => $wgUser->getName(), |
| 496 | + 'revision' => $newrevision, |
| 497 | + 'changed' => count( $changed ), |
| 498 | + ); |
| 499 | + $logger->addEntry( 'mark', $page->getTitle(), null, array( serialize( $params ) ) ); |
| 500 | + |
488 | 501 | $this->setupRenderJobs( $page ); |
489 | 502 | |
490 | 503 | // Re-generate caches |
Index: trunk/extensions/Translate/tag/PageTranslationHooks.php |
— | — | @@ -525,4 +525,20 @@ |
526 | 526 | return true; |
527 | 527 | } |
528 | 528 | |
| 529 | + public static function formatLogEntry( $type, $action, $title, $forContent, $params ) { |
| 530 | + global $wgLang, $wgContLang; |
| 531 | + |
| 532 | + $language = $forContent ? $wgContLang : $wgLang; |
| 533 | + $opts = array( 'parseinline', 'language' => $language ); |
| 534 | + $_ = unserialize( $params[0] ); |
| 535 | + $user = $_['user']; |
| 536 | + |
| 537 | + if ( $action === 'mark' ) { |
| 538 | + $revision = $_['revision']; |
| 539 | + return wfMsgExt( 'pt-log-mark', $opts, $title->getPrefixedText(), $user, $revision ); |
| 540 | + } elseif( $action === 'unmark' ) { |
| 541 | + return wfMsgExt( 'pt-log-unmark', $opts, $title->getPrefixedText(), $user ); |
| 542 | + } |
| 543 | + } |
| 544 | + |
529 | 545 | } |
Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -240,6 +240,13 @@ |
241 | 241 | $wgSpecialPages['PageTranslation'] = 'SpecialPageTranslation'; |
242 | 242 | $wgAvailableRights[] = 'pagetranslation'; |
243 | 243 | |
| 244 | + global $wgLogNames, $wgLogActionsHandlers, $wgLogTypes, $wgLogHeaders; |
| 245 | + $wgLogTypes[] = 'pagetranslation'; |
| 246 | + $wgLogHeaders['pagetranslation'] = 'pt-log-header'; |
| 247 | + $wgLogNames['pagetranslation'] = 'pt-log-name'; |
| 248 | + $wgLogActionsHandlers['pagetranslation/mark'] = 'PageTranslationHooks::formatLogEntry'; |
| 249 | + $wgLogActionsHandlers['pagetranslation/unmark'] = 'PageTranslationHooks::formatLogEntry'; |
| 250 | + |
244 | 251 | // Namespaces |
245 | 252 | global $wgPageTranslationNamespace, $wgExtraNamespaces; |
246 | 253 | global $wgNamespacesWithSubpages, $wgNamespaceProtection; |
Index: trunk/extensions/Translate/PageTranslation.i18n.php |
— | — | @@ -95,7 +95,10 @@ |
96 | 96 | Section text: <pre>$1</pre>', |
97 | 97 | 'pt-shake-empty' => 'Empty section for marker $1.', |
98 | 98 | |
99 | | - |
| 99 | + 'pt-log-header' => 'Log for actions related to the page translation system', |
| 100 | + 'pt-log-name' => 'Page translation log', |
| 101 | + 'pt-log-mark' => '{{GENDER:$2|marked}} revision $3 of page [[:$1]] for translation.', |
| 102 | + 'pt-log-unmark' => '{{GENDER:$2|removed}} page [[:$1]] from translation.', |
100 | 103 | ); |
101 | 104 | |
102 | 105 | /** Message documentation (Message documentation) |