r36744 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36743‎ | r36744 | r36745 >
Date:13:26, 27 June 2008
Author:demon
Status:old
Tags:
Comment:
Localize Virus scanner messages.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messageTypes.inc (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -356,6 +356,10 @@
357357 'customcssjsprotected',
358358 'ns-specialprotected',
359359 'titleprotected',
 360+ 'virus-badscanner',
 361+ 'virus-badscanner',
 362+ 'virus-scanfailed',
 363+ 'virus-unknownscanner',
360364 ),
361365 'login' => array(
362366 'logouttitle',
Index: trunk/phase3/maintenance/language/messageTypes.inc
@@ -313,6 +313,9 @@
314314 'autocomment-prefix',
315315 'listgrouprights-right-display',
316316 'timezone-utc',
 317+ 'virus-badscanner',
 318+ 'virus-scanfailed',
 319+ 'virus-unknownscanner',
317320 );
318321
319322 /** EXIF messages, which may be set as optional in several checks, but are generally mandatory */
Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -1515,9 +1515,8 @@
15161516
15171517 if ( !$wgAntivirusSetup[$wgAntivirus] ) {
15181518 wfDebug( __METHOD__.": unknown virus scanner: $wgAntivirus\n" );
1519 - # @TODO: localise
1520 - $wgOut->addHTML( "<div class='error'>Bad configuration: unknown virus scanner: <i>$wgAntivirus</i></div>\n" );
1521 - return "unknown antivirus: $wgAntivirus";
 1519+ $wgOut->addHTML( "<div class='error'>" . wfMsg('virus-badscanner') . " <i>$wgAntivirus</i></div>\n" );
 1520+ return wfMsg('virus-unknownscanner') . " $wgAntivirus";
15221521 }
15231522
15241523 # look up scanner configuration
@@ -1564,7 +1563,7 @@
15651564 wfDebug( __METHOD__.": failed to scan $file (code $exitCode).\n" );
15661565
15671566 if ( $wgAntivirusRequired ) {
1568 - return "scan failed (code $exitCode)";
 1567+ return wfMsg('virus-scanfailed', array( $exitCode ) );
15691568 } else {
15701569 return NULL;
15711570 }
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -837,6 +837,11 @@
838838 'titleprotected' => "This title has been protected from creation by [[User:$1|$1]].
839839 The reason given is ''$2''.",
840840
 841+# Virus scanner
 842+'virus-badscanner' => "Bad configuration: unknown virus scanner:",
 843+'virus-scanfailed' => "scan failed (code $1)",
 844+'virus-unknownscanner' => "unknown antivirus:",
 845+
841846 # Login and logout pages
842847 'logouttitle' => 'User logout',
843848 'logouttext' => '<strong>You are now logged out.</strong>

Status & tagging log