Use wfMsg()'s parameters
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 15 Nov 2003 14:11:30 +0000 (14:11 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 15 Nov 2003 14:11:30 +0000 (14:11 +0000)
includes/DatabaseFunctions.php
includes/ImagePage.php
includes/SearchEngine.php
includes/Skin.php
includes/SpecialBlockip.php
includes/SpecialContributions.php

index a61de96..3c1ce5a 100644 (file)
@@ -14,8 +14,8 @@ function wfGetDB( $altuser = "", $altpassword = "", $altserver = "", $altdb = ""
        global $wgDBserver, $wgDBuser, $wgDBpassword;
        global $wgDBname, $wgDBconnection, $wgEmergencyContact;
        
-       $noconn = str_replace( "$1", $wgDBserver, wfMsgNoDB( "noconnect" ) );
-       $nodb = str_replace( "$1", $wgDBname, wfMsgNoDB( "nodb" ) );
+       $noconn = wfMsgNoDB( "noconnect", $wgDBserver );
+       $nodb = wfMsgNoDB( "nodb", $wgDBname );
 
        $helpme = "\n<p>If this error persists after reloading and clearing " .
          "your browser cache, please notify the <a href=\"mailto:" .
index 300883f..bc993a8 100644 (file)
@@ -176,8 +176,7 @@ class ImagePage extends Article {
                  Namespace::getWikipedia() ) .
                  ":" . wfMsg( "dellogpage" ), wfMsg( "deletionlog" ) );
 
-               $text = str_replace( "$1" , $deleted, wfMsg( "deletedtext" ) );
-               $text = str_replace( "$2", $loglink, $text );
+               $text = wfMsg( "deletedtext", $deleted, $loglink );
 
                $wgOut->addHTML( "<p>" . $text );
                $wgOut->returnToMain( false );
index 6739bf5..7735318 100644 (file)
@@ -352,7 +352,7 @@ class SearchEngine {
                if ( "" == $contextchars ) { $contextchars = 50; }
 
                $link = $sk->makeKnownLink( $t, "" );
-               $size = str_replace( "$1", strlen( $row->cur_text ), WfMsg( "nbytes" ) );
+               $size = wfMsg( "nbytes", strlen( $row->cur_text ) );
                $wgOut->addHTML( "<li>{$link} ({$size})" );
 
                $lines = explode( "\n", $row->cur_text );
index 0783fb7..fa156be 100644 (file)
@@ -437,7 +437,7 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval )
                                $tl = $this->makeKnownLink( $wgLang->getNsText(
                                Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
                                wfMsg("newmessageslink") );
-                               $s.=" | <strong>". str_replace( "$1", $tl, wfMsg("newmessages") ) . "</strong>";
+                               $s.=" | <strong>". wfMsg( "newmessages", $tl ) . "</strong>";
                        }
                }
                if( $wgUser->isSysop() &&
@@ -646,7 +646,7 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval )
                        $s = "";
                } else {
                        $count = $wgArticle->getCount();
-                       $s = str_replace( "$1", $count, wfMsg( "viewcount" ) );
+                       $s = wfMsg( "viewcount", $count );
                }
                $s .= $this->lastModified();
                $s .= " " . wfMsg( "gnunote" );
@@ -658,7 +658,7 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval )
                global $wgLang, $wgArticle;
 
                $d = $wgLang->timeanddate( $wgArticle->getTimestamp(), true );
-               $s = " " . str_replace( "$1", $d, wfMsg( "lastmodified" ) );
+               $s = " " . wfMsg( "lastmodified", $d );
                return $s;
        }
 
@@ -1840,7 +1840,7 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval )
                else { $ul = $this->makeLink( $wgLang->getNsText(
                  Namespace::getUser() ) . ":{$ut}", $ut ); }
 
-               $nb = str_replace( "$1", $size, wfMsg( "nbytes" ) );
+               $nb = wfMsg( "nbytes", $size );
                $style = $this->getInternalLinkAttributes( $url, $dt );
 
                $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$dt}</a>"
index 5ce5ebf..f03e535 100644 (file)
@@ -91,7 +91,7 @@ class IPBlockForm {
 
                # Make log entry
                $log = new LogPage( wfMsg( "blocklogpage" ), wfMsg( "blocklogtext" ) );
-               $action = str_replace( "$1", $wpBlockAddress, wfMsg( "blocklogentry" ) );
+               $action = wfMsg( "blocklogentry", $wgBlockAddress );
                $log->addEntry( $action, $wpBlockReason );
 
                # Report to the user
@@ -107,7 +107,7 @@ class IPBlockForm {
 
                $wgOut->setPagetitle( wfMsg( "blockip" ) );
                $wgOut->setSubtitle( wfMsg( "blockipsuccesssub" ) );
-               $text = str_replace( "$1", $ip, wfMsg( "blockipsuccesstext" ) );
+               $text = wfMsg( "blockipsuccesstext", $ip );
                $wgOut->addWikiText( $text );
        }
 }
index 32b8453..6719274 100644 (file)
@@ -28,8 +28,7 @@ function wfSpecialContributions( $par = "" )
        else {
                $ul = $sk->makeKnownLink( $nt->getPrefixedText(), $nt->getText() );
        }
-       $sub = str_replace( "$1", $ul, wfMsg( "contribsub" ) );
-       $wgOut->setSubtitle( $sub );
+       $wgOut->setSubtitle( wfMsg( "contribsub", $ul ) );
 
        if ( ! isset( $hideminor ) ) {
                $hideminor = $wgUser->getOption( "hideminor" );