r51282 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51281‎ | r51282 | r51283 >
Date:12:23, 1 June 2009
Author:tstarling
Status:deferred (Comments)
Tags:
Comment:
Split date and time as requested by Nikerabbit.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialRevisiondelete.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php
@@ -632,7 +632,7 @@
633633 // Make error messages less vague
634634 $oldBits = $item->getBits();
635635 if ( $oldBits == $newBits ) {
636 - $status->warning( 'revdelete-no-change', $item->formatDateTime() );
 636+ $status->warning( 'revdelete-no-change', $item->formatDate(), $item->formatTime() );
637637 $status->failCount++;
638638 continue;
639639 } elseif ( $oldBits == 0 && $newBits != 0 ) {
@@ -645,14 +645,14 @@
646646
647647 if ( $item->isCurrent() && $opType == 'hide' ) {
648648 // Cannot hide current version text
649 - $status->error( 'revdelete-hide-current', $item->formatDateTime() );
 649+ $status->error( 'revdelete-hide-current', $item->formatDate(), $item->formatTime() );
650650 $status->failCount++;
651651 continue;
652652 }
653653 if ( !$item->canView() ) {
654654 // Cannot access this revision
655655 $msg = $opType == 'show' ? 'revdelete-show-no-access' : 'revdelete-modify-no-access';
656 - $status->error( $msg, $item->formatDateTime() );
 656+ $status->error( $msg, $item->formatDate(), $item->formatTime() );
657657 $status->failCount++;
658658 continue;
659659 }
@@ -664,7 +664,7 @@
665665 $idsForLog[] = $item->getId();
666666 $status->successCount++;
667667 } else {
668 - $status->error( 'revdelete-concurrent-change', $item->formatDateTime() );
 668+ $status->error( 'revdelete-concurrent-change', $item->formatDate(), $item->formatTime() );
669669 $status->failCount++;
670670 }
671671 }
@@ -876,14 +876,22 @@
877877 }
878878
879879 /**
880 - * Get the timestamp, formatted with $wgLang
 880+ * Get the date, formatted with $wgLang
881881 */
882 - public function formatDateTime() {
 882+ public function formatDate() {
883883 global $wgLang;
884 - return $wgLang->timeanddate( $this->getTimestamp() );
 884+ return $wgLang->date( $this->getTimestamp() );
885885 }
886886
887887 /**
 888+ * Get the date, formatted with $wgLang
 889+ */
 890+ public function formatTime() {
 891+ global $wgLang;
 892+ return $wgLang->time( $this->getTimestamp() );
 893+ }
 894+
 895+ /**
888896 * Get the timestamp in MW 14-char form
889897 */
890898 public function getTimestamp() {
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1329,15 +1329,15 @@
13301330 'revdelete-unhid' => 'unhid $1',
13311331 'revdelete-log-message' => '$1 for $2 {{PLURAL:$2|revision|revisions}}',
13321332 'logdelete-log-message' => '$1 for $2 {{PLURAL:$2|event|events}}',
1333 -'revdelete-hide-current' => 'Error hiding the item dated $1: this is the current revision.
 1333+'revdelete-hide-current' => 'Error hiding the item dated $2, $1: this is the current revision.
13341334 It cannot be hidden.',
1335 -'revdelete-show-no-access' => 'Error showing the item dated $1: this item has been marked "restricted".
 1335+'revdelete-show-no-access' => 'Error showing the item dated $2, $1: this item has been marked "restricted".
13361336 You do not have access to it.',
1337 -'revdelete-modify-no-access' => 'Error modifying the item dated $1: this item has been marked "restricted".
 1337+'revdelete-modify-no-access' => 'Error modifying the item dated $2, $1: this item has been marked "restricted".
13381338 You do not have access to it.',
1339 -'revdelete-modify-missing' => 'Error modifying item ID $1: it is missing from the database!',
1340 -'revdelete-no-change' => "'''Warning:''' the item dated $1 already had the requested visibility settings.",
1341 -'revdelete-concurrent-change' => 'Error modifying the item dated $1: its status appears to have been changed by someone else while you attempted to modify it.
 1339+'revdelete-modify-missing' => 'Error modifying item ID $2, $1: it is missing from the database!',
 1340+'revdelete-no-change' => "'''Warning:''' the item dated $2, $1 already had the requested visibility settings.",
 1341+'revdelete-concurrent-change' => 'Error modifying the item dated $2, $1: its status appears to have been changed by someone else while you attempted to modify it.
13421342 Please check the logs.',
13431343 'revdelete-only-restricted' => 'You cannot suppress items from view by administrators without also selecting one of the other suppression options.',
13441344

Follow-up revisions

RevisionCommit summaryAuthorDate
r51287(r51282) apparent typo in comment corrected.purodha15:15, 1 June 2009
r51314Follow-up on r51282. In 'revdelete-modify-missing' there is no second parameter.siebrand22:00, 1 June 2009

Comments

#Comment by Shinjiman (talk | contribs)   13:24, 1 June 2009

Whe there are "$2" on the message 'revdelete-modify-missing'? Seems the $2 on 'revdelete-modify-missing' is not used.

#Comment by Siebrand (talk | contribs)   22:00, 1 June 2009

Fixed in r51314.

Status & tagging log