fix: pluralization logic in i18n.ts for "ru" (#1537)

This commit is contained in:
Anton 2024-02-23 22:08:04 +03:00 committed by GitHub
parent e8c5e04161
commit bd60cb72e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,6 +13,9 @@ export default createI18n({
}
const teen = choice > 10 && choice < 20
const endsWithOne = choice % 10 === 1
if (choicesLength == 2) {
return choice === 1 ? 0 : 1
}
if (choicesLength < 4) {
return !teen && endsWithOne ? 1 : 2
}