From ccba2f029f135a3d1056f9b2b288161de69f5e85 Mon Sep 17 00:00:00 2001 From: R4SAS Date: Fri, 16 Dec 2016 12:15:37 +0300 Subject: [PATCH] added ru plural formula --- lib/I18n.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/I18n.php b/lib/I18n.php index df9f734..858a89a 100644 --- a/lib/I18n.php +++ b/lib/I18n.php @@ -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;