Fixed custom pluralization for russian

This commit is contained in:
RemixDev 2020-07-29 22:11:47 +02:00
parent 3bb0de2bbf
commit 9eeb992faf
2 changed files with 7 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@ -43,25 +43,22 @@ const i18n = new VueI18n({
* @returns a final choice index to select plural word by
*/
ru: function(choice, choicesLength) {
if (choice === 0) {
return 0
}
var n = Math.abs(choice) % 100
var n1 = n % 10
if (n > 10 && n < 20) {
return 3
}
if (n1 > 1 && n1 < 5) {
return 2
}
if (n1 == 1) {
if (n1 > 1 && n1 < 5) {
return 1
}
return 3
if (n1 == 1) {
return 0
}
return 2
}
}
})