Closed JSteunou closed 9 years ago
Ah, thanks for this. This isn't a trivial fix unfortunately :/ Will fix this asap.
s/asap/as soon as I get time
I'm closing this, the issue is solved and published.
I re-open this because I find a bug. I missed a case in my PR :(
Simple variable are escaped, but not expression.
this.gettext.ngettext('foo', 'foos', length);
this.gettext.ngettext('foo', 'foos', foo.length);
1st works, 2nd does not.
@JSteunou ah thanks for catching this, I'm surprised we haven't run into this yet.
If I remember correctly, we wrap the last value in a function, so its body is never evaluated, so I'm confused about why the 2nd case doesn't work. Maybe we are only looking for identifiers in the AST and not things like member expressions?
Exactly ;) PR submited
wow, you've already submitted a fix while I'm busy taking guesses :) thanks, taking a look
I have an issue with ngettext when I use it like that:
Why evaluate possible variable inside xgettext call?
This should be skipped because the pot just need the singular & plural key.