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

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T11194, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 9194 - Add {{PLURAL:...}} to navigation bar of special:whatlinkshere
Add {{PLURAL:...}} to navigation bar of special:whatlinkshere
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
unspecified
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
http://svn.wikimedia.org/svnroot/medi...
:
Depends on:
Blocks:
  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: ---


Attachments

Description Daniel U. Thibault 2007-03-06 18:11:14 UTC
Trying to use PLURAL: with messages such as
http://fr.wiktionary.org/wiki/Discussion_MediaWiki:Nextn, 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
http://fr.wiktionary.org/wiki/Discussion_MediaWiki:Nextn, setting
http://fr.wiktionary.org/wiki/MediaWiki:Nextn to:

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

And then generating the pages:
*
http://fr.wiktionary.org/w/index.php?title=Special:Whatlinkshere/-issime&limit=1&from=0
* and
*
http://fr.wiktionary.org/w/index.php?title=Special:Whatlinkshere/-issime&limit=2&from=0

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',
'netxn'
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.


Navigation
Links