yii2: i18n plural is not working on production
What steps will reproduce the problem?
In my view, I got:
return Yii::t('nfy', '<strong>{n,plural,=0{No orders} =1{One order} other{# orders}}</strong> need to be fulfilled', ['n' => $this->count]);
In messages (nfy.php) I have
'<strong>{n,plural,=0{No orders} =1{One order} other{# orders}}</strong> need to be fulfilled' => '<strong>{n,plural,=0{Нет заказов} =1{Один заказ} one{# заказ} few{# заказа} many{# заказов} other{# заказа}}</strong> которые нужно отправить',
On a local machine, translation is applied correctly. However, on a production server, I get a raw translation string (this is what gets rendered after Yii::t):
{n,plural,=0{Нет заказов} =1{Один заказ} one{# заказ} few{# заказа} many{# заказов} other{# заказа}} которые нужно отправить
What is the expected result?
It should be like 4 заказа которые нужно отправить
Additional info
| Q | A |
|---|---|
| Yii version | 2.0.10 |
| PHP version | 5.5.38 |
| Operating system | CentOS |
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (8 by maintainers)
Yes. Either change your hosting or persuade them to update.