Page MenuHomePhabricator

Using variables inside plural definitions doesn't work in JavaScript
Closed, ResolvedPublic

Description

{{PLURAL:$1|$3 started this topic|A|0=B|2=C|3=$3}}

mw.msg( "flow-topic-participants", 3 )
'A'

However
{{PLURAL:$1|$3 started this topic|A|0=B|2=C|3=D}}

mw.msg( "flow-topic-participants", 3 )
'D'

I think the use of $3 in the rule 3=$3 is not being parsed correctly.


Version: 1.24rc
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=70617

Details

Reference
bz69993

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:41 AM
bzimport set Reference to bz69993.

(In reply to Jon from comment #0)

{{PLURAL:$1|$3 started this topic|A|0=B|2=C|3=$3}}

mw.msg( "flow-topic-participants", 3 )
'A'

However
{{PLURAL:$1|$3 started this topic|A|0=B|2=C|3=D}}

mw.msg( "flow-topic-participants", 3 )
'D'

I think the use of $3 in the rule 3=$3 is not being parsed correctly.

I guess in your example, $3 should be unexpanded, because it should refer to the third parameter to the message which you didn't pass? Like, you would expect mw.msg( 'flow-topic-participants', 3, 'Alice', 'Bob' ) to return 'Bob'?

mw.msg( "flow-topic-participants", 3, 'a', 'b' )
'A'

Change 156237 had a related patch set uploaded by Santhosh:
Support nesting of expressions in parameters of explicit plural forms

https://gerrit.wikimedia.org/r/156237

Change 156237 merged by jenkins-bot:
Support nesting of expressions in parameters of explicit plural forms

https://gerrit.wikimedia.org/r/156237