diff --git a/src/logic/bill/MonthlyQuantity.php b/src/logic/bill/MonthlyQuantity.php index 493c0393..5656cca1 100644 --- a/src/logic/bill/MonthlyQuantity.php +++ b/src/logic/bill/MonthlyQuantity.php @@ -31,9 +31,12 @@ class MonthlyQuantity extends DefaultQuantityFormatter implements ContextAwareQu */ public function format(): string { - $text = Yii::t('hipanel:finance', '{quantity, plural, one{# day} other{# days}}', ['quantity' => $this->getClientValue()]); + $unitName = $this->getQuantity()->getUnit()->getName(); + if ($unitName === 'hour') { + return Yii::t('hipanel:finance', '{quantity, plural, one{# hour} few{# hours} other{# hours}}', ['quantity' => $this->getQuantity()->getQuantity()]); + } - return $text; + return Yii::t('hipanel:finance', '{quantity, plural, one{# day} other{# days}}', ['quantity' => $this->getClientValue()]); } /** diff --git a/src/messages/ru/hipanel:finance.php b/src/messages/ru/hipanel:finance.php index 413e6565..9b77825f 100644 --- a/src/messages/ru/hipanel:finance.php +++ b/src/messages/ru/hipanel:finance.php @@ -63,6 +63,7 @@ '{quantity, plural, one{# day} other{# days}}' => '{quantity, plural, one{# день} few{# дня} other{# дней}}', '{quantity, plural, one{# year} other{# years}}' => '{quantity, plural, one{# год} few{# года} other{# лет}}', '{quantity, time, HH:mm} hour(s)' => '{quantity, time, HH:mm} час(ов)', + '{quantity, plural, one{# hour} few{# hours} other{# hours}}' => '{quantity, plural, one{# час} few{# часа} other{# часов}}', '{quantity} IP' => '{quantity} IP', 'Held payments' => 'Ожидающие платежи', 'Provided services' => 'Предоставленные услуги',