Polyconseil / vue-gettext

Translate your Vue.js applications with gettext.
MIT License
278 stars 55 forks source link

`translate-plural` not working with `<translate>` #122

Open fjeddy opened 3 years ago

fjeddy commented 3 years ago

Hello,

It seems like translate-plural doesn't work in combination with <translate>, the following code snippet, from your documentation, does not seem to work.

<translate :translate-n="cars" translate-plural="%{ count } cars">%{ count } car</translate> outputs count cars

while <li v-translate="{ count: cars }" translate-plural="%{count} cars" :translate-n="cars">%{count} car</li> works as expected.

Edit I realize now that this might be an underlying bug with count not being treated as it should. If I add the option translate-params, then it works correctly, which is the same thing I'm doing in the v-translate example, specifically defining count.

The following works

<translate :translate-n="cars" translate-plural="%{count} cars" :translate-params="{ count: cars }">%{ count } car</translate>