ttag-org / ttag

:orange_book: simple approach for javascript localization
https://ttag.js.org/
MIT License
338 stars 41 forks source link

Weird ngettext behaviour for strings with no singular form expressions #197

Open clrnd opened 4 years ago

clrnd commented 4 years ago

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.

AlexMost commented 4 years ago

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