r112130 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112129‎ | r112130 | r112131 >
Date:18:40, 22 February 2012
Author:aaron
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.19wmf1 (modified) (history)
  • /branches/wmf/1.19wmf1/includes (modified) (history)
  • /branches/wmf/1.19wmf1/includes/logging/LogFormatter.php (modified) (history)
  • /branches/wmf/1.19wmf1/languages (modified) (history)
  • /branches/wmf/1.19wmf1/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/includes/logging/LogFormatter.php
@@ -173,24 +173,23 @@
174174 $this->plaintext = true;
175175 $text = $this->getActionText();
176176
177 - // wfRunHooks( 'LogEntry::publish', array( $this, $formatter, &$actionText ) );
178 - // function efLegacyLogsIrcFormat( $entry, $formatter, &$text ) {
179 -
180177 $entry = $this->entry;
181178 $parameters = $entry->getParameters();
 179+ // @see LogPage::actionText()
 180+ $msgOpts = array( 'parsemag', 'escape', 'replaceafter', 'content' );
182181 // Text of title the action is aimed at.
183 - $target = $entry->getTarget()->getText() ;
 182+ $target = $entry->getTarget()->getPrefixedText() ;
184183 $text = null;
185184 switch( $entry->getType() ) {
186185 case 'move':
187186 switch( $entry->getSubtype() ) {
188187 case 'move':
189188 $movesource = $parameters['4::target'];
190 - $text = wfMsg( '1movedto2', $target, $movesource );
 189+ $text = wfMsgExt( '1movedto2', $msgOpts, $target, $movesource );
191190 break;
192191 case 'move_redir':
193192 $movesource = $parameters['4::target'];
194 - $text = wfMsg( '1movedto2_redir', $target, $movesource );
 193+ $text = wfMsgExt( '1movedto2_redir', $msgOpts, $target, $movesource );
195194 break;
196195 case 'move-noredirect':
197196 break;
@@ -202,10 +201,10 @@
203202 case 'delete':
204203 switch( $entry->getSubtype() ) {
205204 case 'delete':
206 - $text = wfMsg( 'deletedarticle', $target );
 205+ $text = wfMsgExt( 'deletedarticle', $msgOpts, $target );
207206 break;
208207 case 'restore':
209 - $text = wfMsg( 'undeletedarticle', $target );
 208+ $text = wfMsgExt( 'undeletedarticle', $msgOpts, $target );
210209 break;
211210 //case 'revision': // Revision deletion
212211 //case 'event': // Log deletion
@@ -217,26 +216,10 @@
218217 case 'patrol':
219218 // https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/PatrolLog.php?&pathrev=97495&r1=97494&r2=97495
220219 // Create a diff link to the patrolled revision
221 - $diffLink = Linker::link(
222 - $target,
223 - htmlspecialchars( wfMsg( 'patrol-log-diff', $parameters['4::curid']) ),
224 - array(),
225 - /*query parameters */ array( 'oldid'=>$parameters['4::curid'], 'diff' => 'prev' ),
226 - array( 'known', 'noclasses' )
227 - );
228 - $link = Linker::link( $entry->getTarget() );
229 -
230220 if ( $entry->getSubtype() === 'patrol' ) {
231 - // 'patrol-log-line' => 'marked $1 of $2 patrolled $3',
232 - // 'logentry-irc-patrol-patrol' => '$1 marked revision $4 of page $3 patrolled',
233 -
234 - $text = wfMsg( 'patrol-log-line', $diffLink, $link );
235 - } elseif ( $entry->getSubtype() === 'patrol-auto' ) {
236 - // 'patrol-log-line' => 'marked $1 of $2 patrolled $3',
237 - // 'patrol-log-auto' => '(automatic)',
238 - // 'logentry-irc-patrol-patrol-auto' => '$1 automatically marked revision $4 of page $3 patrolled',
239 - // How is this done with old messages? Some abomination to man?
240 - $text = wfMsg( 'patrol-log-line-auto', $diffLink, $link );
 221+ $diffLink = htmlspecialchars(
 222+ wfMsgForContent( 'patrol-log-diff', $parameters['4::curid'] ) );
 223+ $text = wfMsgForContent( 'patrol-log-line', $diffLink, "[[$target]]", "" );
241224 } else {
242225 // broken??
243226 }
@@ -246,17 +229,28 @@
247230 switch( $entry->getSubtype() ) {
248231 case 'newusers':
249232 case 'create':
250 - $text = wfMsg( 'newuserlog-create-entry' /* no params */ );
 233+ $text = wfMsgExt( 'newuserlog-create-entry', $msgOpts /* no params */ );
251234 break;
252235 case 'create2':
253 - $text = wfMsg( 'newuserlog-create2-entry', $target );
 236+ $text = wfMsgExt( 'newuserlog-create2-entry', $msgOpts, $target );
254237 break;
255238 case 'autocreate':
256 - $text = wfMsg( 'newuserlog-autocreate-entry' /* no params */ );
 239+ $text = wfMsgExt( 'newuserlog-autocreate-entry', $msgOpts /* no params */ );
257240 break;
258241 }
259242 break;
260243
 244+ case 'upload':
 245+ switch( $entry->getSubtype() ) {
 246+ case 'upload':
 247+ $text = wfMsgExt( 'uploadedimage', $msgOpts, $target );
 248+ break;
 249+ case 'overwrite':
 250+ $text = wfMsgExt( 'overwroteimage', $msgOpts, $target );
 251+ break;
 252+ }
 253+ break;
 254+
261255 // case 'suppress' --private log -- aaron (sign your messages so we know who to blame in a few years :-D)
262256 // default:
263257 }
Property changes on: branches/wmf/1.19wmf1/includes
___________________________________________________________________
Modified: svn:mergeinfo
264258 Merged /trunk/phase3/includes:r112079,112128
Index: branches/wmf/1.19wmf1/languages/messages/MessagesEn.php
@@ -4733,6 +4733,8 @@
47344734 'newuserlog-autocreate-entry' => 'Account created automatically',
47354735 'suppressedarticle' => 'suppressed "[[$1]]"',
47364736 'deletedarticle' => 'deleted "[[$1]]"',
 4737+'uploadedimage' => 'uploaded "[[$1]]"',
 4738+'overwroteimage' => 'uploaded a new version of "[[$1]]"',
47374739
47384740 # Feedback
47394741 'feedback-bugornote' => 'If you are ready to describe a technical problem in detail please [$1 report a bug].
@@ -4787,5 +4789,4 @@
47884790 'api-error-unknownerror' => 'Unknown error: "$1".',
47894791 'api-error-uploaddisabled' => 'Uploading is disabled on this wiki.',
47904792 'api-error-verification-error' => 'This file might be corrupt, or have the wrong extension.',
4791 -
47924793 );
Property changes on: branches/wmf/1.19wmf1/languages
___________________________________________________________________
Modified: svn:mergeinfo
47934794 Merged /trunk/phase3/languages:r112128
Property changes on: branches/wmf/1.19wmf1
___________________________________________________________________
Modified: svn:mergeinfo
47944795 Merged /trunk/phase3:r112079,112128

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112079* General log formatting fixes, like using the content language, for IRC feed...aaron02:28, 22 February 2012
r112128r112045/bug 34508: Make upload/upload and overwrite match old IRC formatrobla18:29, 22 February 2012

Status & tagging log