php - How to configure gettext with Yii::t() in Yii2 advanced? -
i'm installed yii2 advanced template , configure yii::t() phpmessagesource, need configure gettextmessagesource. i'm added common/config/main-local.php code:
'i18n' => [ 'translations' => [ 'app*' => [ 'class' => 'yii\i18n\gettextmessagesource', 'basepath' => '@app/messages', 'sourcelanguage' => 'en-us', ], ], ],
put @ frontend/messages/ru-ru app.po file sample text:
msgid "test" msgstr "Текст"
add in view file:
yii::t('app', 'test');
but doesn't work, need store .po files or i'm doing wrong?
'basepath' => '@app/messages',
change 'basepath' => '@common/messages',
or 'basepath' => '@root/common/messages
and replace messages common/messages.
Comments
Post a Comment