kazupon / vue-i18n

:globe_with_meridians: Internationalization plugin for Vue.js
https://kazupon.github.io/vue-i18n/
MIT License
7.26k stars 860 forks source link

Feature Request: Pluralization on multiple parts of text #772

Open fractalf opened 4 years ago

fractalf commented 4 years ago

I've read the docs extensivly looking for this feature, but can't find it.

A lot of times its necessary to have some pluralization only on some parts of a longer text.

Random example of a text property:

To make this work now I would need to text: 'One ... | Many ...' which requires a whole lot of duplicate text.

Wouldn't this be an elegant way of doing it:

The parser would look for [ <single word> | <plur word> ] and substitue accordingly. Is this hard to achieve?

gbyesiltas commented 1 year ago

Yeah I currently have an example of this where I'm trying to do: {hours} hour {minutes} minute left | {hours} hour {minutes} minutes left | {hours} hours {minutes} minute left | {hours} hours {minutes} minutes left

Which is kind of annoying especially considering the fact that we have custom pluralization rules for Russian which makes this even more complex