diff --git a/tests/unit/data/i18n/messages/ru/test.php b/tests/unit/data/i18n/messages/ru/test.php index 8c5ed86207..fd6c6c71c2 100644 --- a/tests/unit/data/i18n/messages/ru/test.php +++ b/tests/unit/data/i18n/messages/ru/test.php @@ -4,4 +4,5 @@ */ return [ 'The dog runs fast.' => 'Собака бегает быстро.', + 'There {n, plural, =0{no cats} =1{one cat} other{are # cats}} on lying on the sofa!' => 'На диване {n, plural, =0{нет кошек} =1{лежит одна кошка} one{лежит # кошка} few{лежит # кошки} many{лежит # кошек} other{лежит # кошки}}!', ]; diff --git a/tests/unit/framework/i18n/I18NTest.php b/tests/unit/framework/i18n/I18NTest.php index a3ab856f1d..2b282f4551 100644 --- a/tests/unit/framework/i18n/I18NTest.php +++ b/tests/unit/framework/i18n/I18NTest.php @@ -126,6 +126,14 @@ class I18NTest extends TestCase $this->assertEquals('1 item', $this->i18n->translate('test', '{0, number} {0, plural, one{item} other{items}}', 1, 'hu')); } + /** + * https://github.com/yiisoft/yii2/issues/7093 + */ + public function testRussianPlurals() + { + $this->assertEquals('На диване лежит 6 кошек!', $this->i18n->translate('test', 'There {n, plural, =0{no cats} =1{one cat} other{are # cats}} on lying on the sofa!', ['n' => 6], 'ru')); + } + /** * https://github.com/yiisoft/yii2/issues/2519 */