Answer the question
In order to leave comments, you need to log in
Why doesn't i18n work in yii2?
web.php:
'components' => [
"language" => 'ru-RU',
'i18n' => [
'translations' => [
'en2ru' => [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@app/messages',
'sourceLanguage' => 'en',
],
],
],
]
<?php
return [
"home" => "дом",
]
<h1>echo \Yii::t('en2ru', 'home') </h1>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question