r85007 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85006‎ | r85007 | r85008 >
Date:13:52, 30 March 2011
Author:purodha
Status:resolved (Comments)
Tags:
Comment:
Add optional parameter $1 for PLURAL use to messages userrights-groupsmember and userrights-groupsmember-auto
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUserrights.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUserrights.php
@@ -429,12 +429,14 @@
430430 }
431431
432432 $grouplist = '';
433 - if( count( $list ) > 0 ) {
434 - $grouplist = wfMsgHtml( 'userrights-groupsmember' );
 433+ $count = count( $list );
 434+ if( $count > 0 ) {
 435+ $grouplist = wfMsgHtml( 'userrights-groupsmember', $count);
435436 $grouplist = '<p>' . $grouplist . ' ' . $wgLang->listToText( $list ) . "</p>\n";
436437 }
437 - if( count( $autolist ) > 0 ) {
438 - $autogrouplistintro = wfMsgHtml( 'userrights-groupsmember-auto' );
 438+ $count = count( $autolist );
 439+ if( $count > 0 ) {
 440+ $autogrouplistintro = wfMsgHtml( 'userrights-groupsmember-auto', $count);
439441 $grouplist .= '<p>' . $autogrouplistintro . ' ' . $wgLang->listToText( $autolist ) . "</p>\n";
440442 }
441443 $wgOut->addHTML(

Follow-up revisions

RevisionCommit summaryAuthorDate
r85008Optional PLURAL parameters introduced in r85007.purodha14:16, 30 March 2011
r85100Fix omission of r85007,...purodha23:23, 31 March 2011

Comments

#Comment by Raymond (talk | contribs)   17:31, 30 March 2011

wfMsgHtml does not work with PLURAL. You have to use wfMsgExt()

#Comment by Nikerabbit (talk | contribs)   18:05, 30 March 2011

Or better yet, wfMessage() :)

#Comment by Purodha (talk | contribs)   23:25, 31 March 2011

Fixed in r85100

Status & tagging log