From 29d030f994d0800dfa8f6c25c582f74ac3371422 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 15 Nov 2003 13:56:14 +0000 Subject: [PATCH] Use wfMsg()'s parameters --- includes/SpecialImagelist.php | 8 +++----- includes/SpecialIpblocklist.php | 10 ++++------ includes/SpecialLockdb.php | 3 +-- includes/SpecialLongpages.php | 2 +- includes/SpecialMaintenance.php | 10 ++++------ 5 files changed, 13 insertions(+), 20 deletions(-) diff --git a/includes/SpecialImagelist.php b/includes/SpecialImagelist.php index 2b0a49fd38..9224467145 100644 --- a/includes/SpecialImagelist.php +++ b/includes/SpecialImagelist.php @@ -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}
\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}
\n

" ); $res = wfQuery( $sql, DB_READ, "wfSpecialImagelist" ); @@ -96,7 +94,7 @@ function wfSpecialImagelist() $ilink = "{$name}"; - $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" ) ) . diff --git a/includes/SpecialIpblocklist.php b/includes/SpecialIpblocklist.php index 2cd660c15d..9368bd4e3f 100644 --- a/includes/SpecialIpblocklist.php +++ b/includes/SpecialIpblocklist.php @@ -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( "

  • {$line}" ); if ( !$block->mAuto ) { diff --git a/includes/SpecialLockdb.php b/includes/SpecialLockdb.php index f72b2226f0..5d6be73f36 100644 --- a/includes/SpecialLockdb.php +++ b/includes/SpecialLockdb.php @@ -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 ) ); } } diff --git a/includes/SpecialLongpages.php b/includes/SpecialLongpages.php index 2203f5a17f..0ebcb7e3c9 100644 --- a/includes/SpecialLongpages.php +++ b/includes/SpecialLongpages.php @@ -34,7 +34,7 @@ function wfSpecialLongpages() $s = "
      "; while ( $obj = wfFetchObject( $res ) ) { - $nb = str_replace( "$1", $obj->len, wfMsg( "nbytes" ) ); + $nb = wfMsg( "nbytes", $obj->len ); $link = $sk->makeKnownLink( $obj->cur_title, "" ); $s .= "
    1. {$link} ({$nb})
    2. \n"; } diff --git a/includes/SpecialMaintenance.php b/includes/SpecialMaintenance.php index 9538ed990a..ab3d61eb8f 100644 --- a/includes/SpecialMaintenance.php +++ b/includes/SpecialMaintenance.php @@ -113,9 +113,8 @@ function wfSpecialDisambiguations() $sk = $wgUser->getSkin(); - $top = "

      ".wfMsg("disambiguationstext")."


      \n"; - $top = str_replace ( "$1" , $sk->makeKnownLink ( $dp ) , $top ) ; - $top = getMaintenancePageBacklink().$top ; + $top = "

      ".wfMsg( "disambiguationstext", $sk->makeKnownLink( $dp ) )."


      \n"; + $top = getMaintenancePageBacklink() . $top; $top .= wfShowingResults( $offset, $limit ); $wgOut->addHTML( "

      {$top}\n" ); @@ -289,7 +288,7 @@ function wfSpecialMispeelings () } } $top = getMaintenancePageBacklink(); - $top .= "

      ".str_replace("$1",$msl,wfMsg("mispeelingstext"))."


      \n"; + $top .= "

      ".wfMsg( "mispeelingstext", $msl )."


      \n"; $top .= wfShowingResults( $offset, $limit ); $wgOut->addHTML( "

      {$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 .= "

      $mll


      "; -- 2.20.1