Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: exhaustive plural syntax #754

Open
dilame opened this issue Dec 18, 2023 Discussed in #753 · 0 comments
Open

Feature request: exhaustive plural syntax #754

dilame opened this issue Dec 18, 2023 Discussed in #753 · 0 comments

Comments

@dilame
Copy link

dilame commented Dec 18, 2023

Discussed in #753

Originally posted by dilame December 18, 2023
In russian, we have 3 forms of plurals. And there is no way to describe it with typesafe-i18n.

const ruCardinalRules = new Intl.PluralRules("ru-RU");
ruCardinalRules.select(0) // many
ruCardinalRules.select(1) // one 
ruCardinalRules.select(2) // few 
ruCardinalRules.select(100) // many

We can describe it as 'one' | 'few' | 'many'.

None of overloads enumerated in docs fits russian usecase. The only way i found is use full syntax with random strings

'У меня есть {0} {{empty|яблоко|empty|яблока|яблок|empty}}'

I think we need some syntax to selectively describe only needed forms. It could look something like this

'У меня есть {0} {{one:яблоко|few:яблока|many:яблок}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant