r49637 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49636‎ | r49637 | r49638 >
Date:23:03, 18 April 2009
Author:siebrand
Status:ok
Tags:
Comment:
Use wfMsg and a regular variable instead of sprintf
Modified paths:
  • /trunk/extensions/ImportUsers/SpecialImportUsers.i18n.php (modified) (history)
  • /trunk/extensions/ImportUsers/SpecialImportUsers_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ImportUsers/SpecialImportUsers_body.php
@@ -66,7 +66,7 @@
6767 foreach ($filedata as $line=>$newuserstr) {
6868 $newuserarray=explode(',', trim( $newuserstr ) );
6969 if (count($newuserarray)<2) {
70 - $output.=sprintf(wfMsg( 'importusers-user-invalid-format' ) ,$line+1 ).'<br />';
 70+ $output.= wfMsg( 'importusers-user-invalid-format', $line+1 ) . '<br />';
7171 continue;
7272 }
7373 if (!IsSet($newuserarray[2])) $newuserarray[2]='';
@@ -79,16 +79,16 @@
8080 $NextUser->addToDatabase();
8181 $NextUser->setPassword( $newuserarray[1] );
8282 $NextUser->saveSettings();
83 - $output.=sprintf(wfMsg( 'importusers-user-added' ) ,$newuserarray[0] ).'<br />';
 83+ $output.= wfMsg( 'importusers-user-added', $newuserarray[0] ) . '<br />';
8484 $summary['added']++;
8585 } else {
8686 if ($replace_present) {
8787 $NextUser->setPassword( $newuserarray[1] );
8888 $NextUser->saveSettings();
89 - $output.=sprintf( wfMsg( 'importusers-user-present-update' ) ,$newuserarray[0] ).'<br />';
 89+ $output.= wfMsg( 'importusers-user-present-update', $newuserarray[0] ).'<br />';
9090 $summary['updated']++;
9191 } else {
92 - $output .= sprintf( wfMsg( 'importusers-user-present-no-update' ) ,$newuserarray[0] ) . '<br />';
 92+ $output .= wfMsg( 'importusers-user-present-no-update', $newuserarray[0] ) . '<br />';
9393 }
9494 }
9595 $summary['all']++;
Index: trunk/extensions/ImportUsers/SpecialImportUsers.i18n.php
@@ -14,11 +14,14 @@
1515 'importusers-form-file' => 'User file format (CSV):',
1616 'importusers-form-replace-present' => 'Replace existing users',
1717 'importusers-form-button' => 'Import',
18 - 'importusers-user-added' => 'User <b>%s</b> has been added.',
19 - 'importusers-user-present-update' => 'User <b>%s</b> already exists. Updated.',
20 - 'importusers-user-present-not-update' => 'User <b>%s</b> already exists. Did not update.',
21 - 'importusers-user-invalid-format' => 'User data in the line #%s has invalid format or is blank. Skipped.',
22 - 'importusers-log' => 'Import users log',
 18+ 'importusers-user-added' => 'User \'\'\'$1\'\'\' has been added.',
 19+ 'importusers-user-present-update' => 'User \'\'\'$1\'\'\' already exists.
 20+Updated.',
 21+ 'importusers-user-present-not-update' => 'User \'\'\'$1\'\'\' already exists.
 22+Did not update.',
 23+ 'importusers-user-invalid-format' => 'User data in the line #$1 has invalid format or is blank.
 24+Skipped.',
 25+ 'importusers-log' => 'Import log',
2326 'importusers-log-summary' => 'Summary',
2427 'importusers-log-summary-all' => 'All',
2528 'importusers-log-summary-added' => 'Added',

Follow-up revisions

RevisionCommit summaryAuthorDate
r49641Revert accidental revert in r49637 of change in 'importusers-log' from r49625siebrand09:44, 19 April 2009

Status & tagging log