Use wfMsg()'s parameters
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 15 Nov 2003 13:56:14 +0000 (13:56 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 15 Nov 2003 13:56:14 +0000 (13:56 +0000)
includes/SpecialImagelist.php
includes/SpecialIpblocklist.php
includes/SpecialLockdb.php
includes/SpecialLongpages.php
includes/SpecialMaintenance.php

index 2b0a49f..9224467 100644 (file)
@@ -68,8 +68,7 @@ function wfSpecialImagelist()
                $fill .= $sk->makeKnownLink( $here, "{$num}",
                  "sort=bysize&limit={$num}" );
        }
-       $text = str_replace( "$1", $fill, wfMsg( "showlast" ) );
-       $text = str_replace( "$2", $bysize, $text );
+       $text = wfMsg( "showlast", $fill, $bysize );
        $wgOut->addHTML( "{$text}<br>\n" );
 
        $fill = "";
@@ -81,8 +80,7 @@ function wfSpecialImagelist()
                $fill .= $sk->makeKnownLink( $here, $num,
                  "sort=bydate&limit={$num}" );
        }
-       $text = str_replace( "$1", $fill, wfMsg( "showlast" ) );
-       $text = str_replace( "$2", $bydate, $text );
+       $text = wfMsg( "showlast", $fill, $bydate );
        $wgOut->addHTML( "{$text}<br>\n<p>" );
 
        $res = wfQuery( $sql, DB_READ, "wfSpecialImagelist" );
@@ -96,7 +94,7 @@ function wfSpecialImagelist()
                $ilink = "<a href=\"" . wfImageUrl( $name ) .
                  "\">{$name}</a>";
 
-               $nb = str_replace( "$1", $s->img_size, wfMsg( "nbytes" ) );
+               $nb = wfMsg( "nbytes", $s->img_size );
                $l = "(" .
                  $sk->makeKnownLink( $wgLang->getNsText(
                  Namespace::getImage() ) . ":{$name}", wfMsg( "imgdesc" ) ) .
index 2cd660c..9368bd4 100644 (file)
@@ -9,7 +9,7 @@ function wfSpecialIpblocklist()
        $ipu = new IPUnblockForm();
 
        if ( "success" == $action ) {
-               $msg = str_replace( "$1", $ip, wfMsg( "ipusuccess" ) );
+               $msg = wfMsg( "ipusuccess", $ip );
                $ipu->showList( $msg );
        } else if ( "submit" == $action ) {
                if ( ! $wgUser->isSysop() ) {
@@ -83,7 +83,7 @@ class IPUnblockForm {
 
                # Make log entry
                $log = new LogPage( wfMsg( "blocklogpage" ), wfMsg( "blocklogtext" ) );
-               $action = str_replace( "$1", $wpUnblockAddress, wfMsg( "unblocklogentry" ) );
+               $action = wfMsg( "unblocklogentry", $wpUnblockAddress );
                $log->addEntry( $action, $wpUnblockReason );
 
                # Report to the user
@@ -119,10 +119,8 @@ function wfAddRow( $block, $tag ) {
        $ulink = $sk->makeKnownLink( $wgLang->getNsText( Namespace::getUser() ). ":{$name}", $name );
        $d = $wgLang->timeanddate( $block->mTimestamp, true );
 
-       $line = str_replace( "$1", $d, wfMsg( "blocklistline" ) );
-       $line = str_replace( "$2", $ulink, $line );
-       $line = str_replace( "$3", $addr, $line );
-
+       $line = wfMsg( "blocklistline", $d, $ulink, $addr );
+       
        $wgOut->addHTML( "<li>{$line}" );
        
        if ( !$block->mAuto ) {
index f72b222..5d6be73 100644 (file)
@@ -88,8 +88,7 @@ class DBLockForm {
 
                $wgOut->setPagetitle( wfMsg( "lockdb" ) );
                $wgOut->setSubtitle( wfMsg( "lockdbsuccesssub" ) );
-               $text = str_replace( "$1", $ip, wfMsg( "lockdbsuccesstext" ) );
-               $wgOut->addWikiText( $text );
+               $wgOut->addWikiText( wfMsg( "lockdbsuccesstext", $ip ) );
        }
 }
 
index 2203f5a..0ebcb7e 100644 (file)
@@ -34,7 +34,7 @@ function wfSpecialLongpages()
 
        $s = "<ol start=" . ( $offset + 1 ) . ">";
        while ( $obj = wfFetchObject( $res ) ) {
-               $nb = str_replace( "$1", $obj->len, wfMsg( "nbytes" ) );
+               $nb = wfMsg( "nbytes", $obj->len );
                $link = $sk->makeKnownLink( $obj->cur_title, "" );
                $s .= "<li>{$link} ({$nb})</li>\n";
        }
index 9538ed9..ab3d61e 100644 (file)
@@ -113,9 +113,8 @@ function wfSpecialDisambiguations()
 
        $sk = $wgUser->getSkin();
 
-       $top = "<p>".wfMsg("disambiguationstext")."</p><br>\n";
-       $top = str_replace ( "$1" , $sk->makeKnownLink ( $dp ) , $top ) ;
-       $top = getMaintenancePageBacklink().$top ;
+       $top = "<p>".wfMsg( "disambiguationstext", $sk->makeKnownLink( $dp ) )."</p><br>\n";
+       $top = getMaintenancePageBacklink() . $top;
        $top .= wfShowingResults( $offset, $limit );
        $wgOut->addHTML( "<p>{$top}\n" );
 
@@ -289,7 +288,7 @@ function wfSpecialMispeelings ()
                         }
                 }
         $top = getMaintenancePageBacklink();
-        $top .= "<p>".str_replace("$1",$msl,wfMsg("mispeelingstext"))."</p><br>\n";
+        $top .= "<p>".wfMsg( "mispeelingstext", $msl )."</p><br>\n";
         $top .= wfShowingResults( $offset, $limit );
         $wgOut->addHTML( "<p>{$top}\n" );
 
@@ -318,8 +317,7 @@ function wfSpecialMissingLanguageLinks()
        $res = wfQuery( $sql, DB_READ, $fname );
 
 
-       $mll = wfMsg("missinglanguagelinkstext");
-       $mll = str_replace ( "$1" , $wgLang->getLanguageName($thelang) , $mll ) ;
+       $mll = wfMsg( "missinglanguagelinkstext", $wgLang->getLanguageName($thelang) );
 
        $top = getMaintenancePageBacklink();
        $top .= "<p>$mll</p><br>";