From a07ade165eef718840d01c6633339ffcd7b0bfd2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Thu, 8 Sep 2011 09:09:38 +0000 Subject: [PATCH] Enabled MoveLogFormatter -> This brings better i18n even to existing move log entries Fixed the class name from r96441, it's Move not Block Added notes about new naming conventions to DefaultSettings.php -> didn't bother the remain existing messages now, they will keep working Didn't remove 1movedto2*, they are still used until I commit the code which actually makes new style log entries. --- includes/AutoLoader.php | 2 +- includes/DefaultSettings.php | 17 +++++++++++++---- includes/logging/LogFormatter.php | 6 ++---- languages/messages/MessagesEn.php | 6 ++++++ maintenance/language/messages.inc | 7 +++++++ 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 1cbfaf0fec..4d00bd3821 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -539,7 +539,7 @@ $wgAutoloadLocalClasses = array( 'ManualLogEntry' => 'includes/logging/LogEntry.php', 'LogFormatter' => 'includes/logging/LogFormatter.php', 'LegacyLogFormatter' => 'includes/logging/LogFormatter.php', - 'BlockLogFormatter' => 'includes/logging/LogFormatter.php', + 'MoveLogFormatter' => 'includes/logging/LogFormatter.php', # includes/media 'BitmapHandler' => 'includes/media/Bitmap.php', diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 23cdb6e8d7..b7d9e0012e 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -4909,7 +4909,8 @@ $wgCategoryCollation = 'uppercase'; * an action, which is a specific kind of event that can exist in that * log type. */ -$wgLogTypes = array( '', +$wgLogTypes = array( + '', 'block', 'protect', 'rights', @@ -4962,6 +4963,9 @@ $wgFilterLogTypes = array( * will be listed in the user interface. * * Extensions with custom log types may add to this array. + * + * Since 1.19, if you follow the naming convention log-name-TYPE, + * where TYPE is your log type, yoy don't need to use this array. */ $wgLogNames = array( '' => 'all-logs-page', @@ -4982,6 +4986,9 @@ $wgLogNames = array( * top of each log type. * * Extensions with custom log types may add to this array. + * + * Since 1.19, if you follow the naming convention log-description-TYPE, + * where TYPE is your log type, yoy don't need to use this array. */ $wgLogHeaders = array( '' => 'alllogstext', @@ -5020,8 +5027,6 @@ $wgLogActions = array( 'upload/upload' => 'uploadedimage', 'upload/overwrite' => 'overwroteimage', 'upload/revert' => 'uploadedimage', - 'move/move' => '1movedto2', - 'move/move_redir' => '1movedto2_redir', 'import/upload' => 'import-logentry-upload', 'import/interwiki' => 'import-logentry-interwiki', 'merge/merge' => 'pagemerge-logentry', @@ -5038,8 +5043,12 @@ $wgLogActions = array( * The same as above, but here values are names of functions, * not messages. * @see LogPage::actionText + * @see LogFormatter */ -$wgLogActionsHandlers = array(); +$wgLogActionsHandlers = array( + // move, move_redir + 'move/*' => 'MoveLogFormatter', +); /** * Maintain a log of newusers at Log/newusers? diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php index a036248040..d740d74678 100644 --- a/includes/logging/LogFormatter.php +++ b/includes/logging/LogFormatter.php @@ -56,9 +56,7 @@ class LogFormatter { // Nonstatic-> - /** - * @var LogEntry - */ + /// @var LogEntry protected $entry; /// Whether to output user tool links @@ -323,7 +321,7 @@ class LegacyLogFormatter extends LogFormatter { * This class formats Block log entries. * @since 1.19 */ -class BlockLogFormatter extends LogFormatter { +class MoveLogFormatter extends LogFormatter { protected function getMessageKey() { $key = parent::getMessageKey(); $params = $this->getMessageParameters(); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index b754fb3c0d..ad7ba0e549 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -4638,4 +4638,10 @@ This site is experiencing technical difficulties.', 'sqlite-has-fts' => '$1 with full-text search support', 'sqlite-no-fts' => '$1 without full-text search support', +# New logging system +'logentry-move-move' => '$1 {{GENDER:$2|moved}} page $3 to $4', +'logentry-move-move-noredirect' => '$1 {{GENDER:$2|moved}} page $3 to $4 without leaving a redirect', +'logentry-move-move_redir' => '$1 {{GENDER:$2|moved}} page $3 to $4 over redirect', +'logentry-move-move_redir-noredirect' => '$1 {{GENDER:$2|moved}} page $3 to $4 over a redirect without leaving a redirect', + ); diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 66514e3877..6c6d8d13cf 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -3506,6 +3506,12 @@ $wgMessageStructure = array( 'unwatch' => array( 'confirm-unwatch-button', ), + 'logging' => array( + 'logentry-move-move', + 'logentry-move-move-noredirect', + 'logentry-move-move_redir', + 'logentry-move-move_redir-noredirect', + ), ); /** Comments for each block */ @@ -3737,4 +3743,5 @@ Variants for Chinese language", 'db-error-messages' => 'Database error messages', 'html-forms' => 'HTML forms', 'sqlite' => 'SQLite database support', + 'logging' => 'New logging system', ); -- 2.20.1