Last modified: 2007-04-02 07:25:42 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 9194 - Add {{PLURAL:...}} to navigation bar of special:whatlinkshere
Add {{PLURAL:...}} to navigation bar of special:whatlinkshere
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2007-03-06 18:11 UTC by Daniel U. Thibault
Modified: 2007-04-02 07:25 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Daniel U. Thibault 2007-03-06 18:11:14 UTC
Trying to use PLURAL: with messages such as, I've come to the
conclusion the implementation is defective (or my understanding is deeply
flawed).  It seems the parameters passed to PLURAL: within the context of
mediawiki messages fail to pass the numeric test, regardless of their value
(e.g. {{PLURAL:$1||s}} returns '' instead of 's' for $1 = 2 or better). 
Currently, the function reads:

function convertPlural($count, $w1, $w2, $w3, $w4, $w5) {
return $count <= '1' ? $w1 : $w2;

I suspect it should be instead:

function convertPlural($count, $w1, $w2, $w3, $w4, $w5) {
return $count <= 1 ? $w1 : $w2;
Comment 1 Daniel U. Thibault 2007-03-06 18:15:11 UTC
As explained (in French) on, setting to:

$1 suivant{{PLURAL:$1||s}}

And then generating the pages:
* and

Should give (Nextn output in bold):
* "Voir (1 précédents) ('''1 suivant''') (20 | 50 | 100 | 250 | 500)."
* and:
* "Voir (2 précédents) ('''2 suivants''') (20 | 50 | 100 | 250 | 500)."

But actually yields:
* "Voir (1 précédents) ('''1 suivant''') (20 | 50 | 100 | 250 | 500)."
* and
* "Voir (2 précédents) ('''2 suivant''') (20 | 50 | 100 | 250 | 500)."
Comment 2 Niklas Laxström 2007-03-07 11:13:38 UTC
The code is correct, those messages just don't support plural (yet).
Comment 3 Daniel U. Thibault 2007-03-07 16:09:13 UTC
Say what? The messages are invoked (if you change them, the results are
immediately apparent), so how could the parser not pass the buck on to the
plural function? Please explain.
Comment 4 Niklas Laxström 2007-03-07 16:19:41 UTC
They either do not go through parser or go through it too early before the
number is substituted. 
Comment 5 Daniel U. Thibault 2007-03-07 22:11:06 UTC
Ah, I see.  So the software either strips the template out completely, or passes
it the unmodified string "$1".  Should be easy to fix, no?
Comment 6 Raimond Spekking 2007-03-07 22:14:09 UTC
If someone want to fix it, I may point to bug 4777: Separate messages 'prevn',
Comment 7 Raimond Spekking 2007-04-02 07:25:42 UTC
Fixed with r20905.

Note You need to log in before you can comment on or make changes to this bug.