From 3c8690d8c478b4324ba4e0ecf26fb2fcd4de7237 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Wed, 11 Jun 2008 12:07:58 +0000 Subject: [PATCH] Reapply support of plural for 'linkstoimage', 'redirectstofile' and 'duplicatesoffile' Now w/o breaking customized messages. --- includes/ImagePage.php | 22 +++++++++++----------- languages/messages/MessagesDe.php | 6 +++--- languages/messages/MessagesEn.php | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) 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( "