From: Raimond Spekking Date: Wed, 11 Jun 2008 12:07:58 +0000 (+0000) Subject: Reapply support of plural for 'linkstoimage', 'redirectstofile' and 'duplicatesoffile' X-Git-Tag: 1.31.0-rc.0~47049 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=3c8690d8c478b4324ba4e0ecf26fb2fcd4de7237;p=lhc%2Fweb%2Fwiklou.git Reapply support of plural for 'linkstoimage', 'redirectstofile' and 'duplicatesoffile' Now w/o breaking customized messages. --- diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 55e63baffe..901a54b87a 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -630,7 +630,7 @@ EOT function imageLinks() { global $wgUser, $wgOut; - + $limit = 100; $dbr = wfGetDB( DB_SLAVE ); @@ -642,15 +642,15 @@ EOT __METHOD__, array( 'LIMIT' => $limit + 1) ); - - if ( 0 == $dbr->numRows( $res ) ) { + $count = $dbr->numRows( $res ); + if ( $count == 0 ) { $wgOut->addHTML( "
\n" ); $wgOut->addWikiMsg( 'nolinkstoimage' ); $wgOut->addHTML( "
\n" ); return; } $wgOut->addHTML( "
\n" ); - $wgOut->addWikiMsg( 'linkstoimage' ); + $wgOut->addWikiText( wfMsgExt( 'linkstoimage', array( 'parsemag' ), $count ) ); $wgOut->addHTML( "
\n" ); $res->free(); - + // Add a links to [[Special:Whatlinkshere]] if ( $count > $limit ) $wgOut->addWikiMsg( 'morelinkstoimage', $this->mTitle->getPrefixedDBkey() ); } - function imageRedirects() + function imageRedirects() { global $wgUser, $wgOut; - + $redirects = $this->getTitle()->getRedirectsHere( NS_IMAGE ); if ( count( $redirects ) == 0 ) return; $wgOut->addHTML( "
\n" ); - $wgOut->addWikiMsg( 'redirectstofile' ); + $wgOut->addWikiText( wfMsgExt( 'redirectstofile', array( 'parsemag' ), count( $redirects ) ) ); $wgOut->addHTML( "
\n" ); } - + function imageDupes() { - global $wgOut, $wgUser; + global $wgOut, $wgUser; $this->loadFile(); @@ -701,7 +701,7 @@ EOT if ( count( $dupes ) == 0 ) return; $wgOut->addHTML( "
\n" ); - $wgOut->addWikiMsg( 'duplicatesoffile' ); + $wgOut->addWikiText( wfMsgExt( 'duplicatesoffile', array( 'parsemag' ), count( $dupes ) ) ); $wgOut->addHTML( "