added ru plural formula

This commit is contained in:
R4SAS 2016-12-16 12:15:37 +03:00 committed by GitHub
parent 6ff5caf758
commit ccba2f029f

View file

@ -299,6 +299,8 @@ class I18n
return $n > 1 ? 1 : 0;
case 'pl':
return $n == 1 ? 0 : $n % 10 >= 2 && $n % 10 <= 4 && ($n % 100 < 10 || $n % 100 >= 20) ? 1 : 2;
case 'ru':
return $n % 10==1 && $n % 100 != 11 ? 0 : ($n % 10 >= 2 && $n % 10 <= 4 && ($n % 100 < 10 || $n % 100 >= 20) ? 1 : 2);
// en, de
default:
return $n != 1 ? 1 : 0;