mirror of
https://github.com/openvk/openvk
synced 2025-04-19 14:43:01 +03:00
Revert "fix(locale-core): plural numbers for russian or maybe slavic languages"
This reverts commit c0efd19fcd
.
This commit is contained in:
parent
8be6fae0dd
commit
bed2c9748b
2 changed files with 10 additions and 12 deletions
|
@ -121,17 +121,15 @@ function tr(string $stringId, ...$variables): string
|
||||||
if (gettype($variables[0]) === "integer") {
|
if (gettype($variables[0]) === "integer") {
|
||||||
$numberedStringId = null;
|
$numberedStringId = null;
|
||||||
$cardinal = $variables[0];
|
$cardinal = $variables[0];
|
||||||
// WARNING: Hardcoded for russian language
|
switch ($cardinal) {
|
||||||
if ($cardinal == 0) {
|
case 0:
|
||||||
$numberedStringId = $stringId . "_zero";
|
$numberedStringId = $stringId . "_zero";
|
||||||
} else if ($cardinal == 1 || $cardinal % 10 == 1) {
|
break;
|
||||||
|
case 1:
|
||||||
$numberedStringId = $stringId . "_one";
|
$numberedStringId = $stringId . "_one";
|
||||||
} else if (($cardinal % 10 >= 2 && $cardinal % 10 <= 4) || !($cardinal % 100 >= 12 && $cardinal % 100 <= 14)) {
|
break;
|
||||||
$numberedStringId = $stringId . "_few";
|
default:
|
||||||
} else if ($cardinal % 10 == 0 || ($cardinal % 10 >= 5 && $cardinal % 10 <= 9) || ($cardinal % 100 >= 11 && $cardinal % 100 <= 14)) {
|
$numberedStringId = $stringId . ($cardinal < 5 ? "_few" : "_other");
|
||||||
$numberedStringId = $stringId . "_many";
|
|
||||||
} else {
|
|
||||||
$numberedStringId = $stringId . "_other";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$newOutput = $localizer->_($numberedStringId, $lang);
|
$newOutput = $localizer->_($numberedStringId, $lang);
|
||||||
|
|
|
@ -84,7 +84,7 @@
|
||||||
"desc_none" = "описание отсутствует";
|
"desc_none" = "описание отсутствует";
|
||||||
"send" = "Отправить";
|
"send" = "Отправить";
|
||||||
"years_zero" = "0 лет";
|
"years_zero" = "0 лет";
|
||||||
"years_one" = "$1 год";
|
"years_one" = "1 год";
|
||||||
"years_few" = "$1 года";
|
"years_few" = "$1 года";
|
||||||
"years_many" = "$1 лет";
|
"years_many" = "$1 лет";
|
||||||
"years_other" = "$1 лет";
|
"years_other" = "$1 лет";
|
||||||
|
|
Loading…
Reference in a new issue