fabi1cazenave/webL10n

Support nested conditional expressions

stasm opened this issue · 2 comments

Currently, it looks like the l20n parser doesn't support conditional expressions which branch into another conditional expressions:

<plural(n)   { n==1 ? "one" : n<5 ? "twofour" : "many" }>

Kaze pointed out that the following macro works fine:

<plural(n) { n == 0 ? "none" : n == 1 ? "one" : "many" }>

(See http://kazhack.org/webL10n/test.html, macro.intl.)

When I changed == to < I got a parsing error, so it's probably related to support of binary expressions.

Right: <= was supported but < was not. I’ve fixed the related regexp, binary expressions should work fine now. Thanks for testing!

PS: the LOL test page has moved, see: http://kazhack.org/webL10n/LOL/