Page MenuHomePhabricator

Selective expansion of expressions in {{plural:}}
Closed, InvalidPublic

Description

Author: martins+bugzilla

Description:
The {{plural:}} magic word will expand some expressions, but not others. This is a little confusing, especially as the advertised use of expressions (x mod 10, for Russian-like languages) isn't supported by default.

Examples:

{{plural:0|is|are}} → are (OK)
{{plural:1*1|is|are}} → is (OK)
{{plural:21 mod 10|is|are}} → are (UNEXPECTED)
{{plural:{{#expr:21 mod 10}}|is|are}} → is (OK)
{{plural:1|is|are}} → is (OK)
{{plural:2|is|are}} → are (OK)


Version: unspecified
Severity: normal

Details

Reference
bz27233

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:17 PM
bzimport set Reference to bz27233.
bzimport added a subscriber: Unknown Object (MLST).

Is plural supposed to expand any expressions at all.

I thought it was supposed to work {{plural:<some number>|foo|bar}} and if the number needs to be modded 10 in the content laguage, the software will do it.

For example in russian (This is my understanding. could be wrong)
{{plural:1|foo|bar|baz}} = {{plural:21|foo|bar|baz}} = foo

{{plural:2|foo|bar|baz}} = {{plural:3|foo|bar|baz}} = bar

{{plural:0|foo|bar|baz}} = {{plural:5|foo|bar|baz}} = baz

(I'll leave this open in case i totally misunderstood how plural works and just made a fool of myself)

I think to really answer this, we'd have to have someone test the output of

{{plural:1*2|is|are}} and {{plural:2*1|is|are}}

Otherwise, it just looks to me like 1*1 in Martin's original post is not being expanded at all.