ttag icon indicating copy to clipboard operation
ttag copied to clipboard

Weird ngettext behaviour for strings with no singular form expressions

Open clrnd opened this issue 4 years ago • 1 comments

Strings are not being translated if the msgid tagged string doesn't have any expression in it.

I've set up a minimum working example here: https://github.com/alvare/ttag-bug-mwe

If you do npm run counter-uk you'll get the string with the placeholders and no replacement.

✔ uk.po updated
починаємо рахунок до 3
something again ${ i }
something
something again ${ i }
something again ${ i }

This happens because the t function iterates over the msgid to find replacements when translating, and if it has none then it doesn't do any replacement on the plural string.

clrnd avatar Apr 28 '20 20:04 clrnd

Hi @alvare! Seems like a bug, thanks for the report, will take a look ASAP.

AlexMost avatar Apr 29 '20 12:04 AlexMost