Enabled MoveLogFormatter
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 8 Sep 2011 09:09:38 +0000 (09:09 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 8 Sep 2011 09:09:38 +0000 (09:09 +0000)
-> 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
includes/DefaultSettings.php
includes/logging/LogFormatter.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 1cbfaf0..4d00bd3 100644 (file)
@@ -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',
index 23cdb6e..b7d9e00 100644 (file)
@@ -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?
index a036248..d740d74 100644 (file)
@@ -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();
index b754fb3..ad7ba0e 100644 (file)
@@ -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',
+
 );
index 66514e3..6c6d8d1 100644 (file)
@@ -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',
 );