internationalization - Using Yii2's default messages -
i can't figure out, how use yii's default messages, without overwriting them message command.
i have 2 translation categories: app, data.
i'd use default messages, "are sure want delete item?" , "(not set)" yii2 core, if use yii::t('yii', 'are sure want delete item?')
, run yii message
command, creates yii.php file in messages folder token.
part of config:
'i18n' => [ 'translations' => [ 'app*' => [ 'class' => 'yii\i18n\phpmessagesource', 'basepath' => '@app/messages', ], 'data*' => [ 'class' => 'yii\i18n\phpmessagesource', 'basepath' => '@app/messages', ], ], ],
how should set config use built in texts , not overwrite them?
you don't have anything. yii
-category automatically defined use translation , points messages in framework.
that creates empty file 'yii' normal, because use category in code. unrelated messages loaded during normal execution.
just make sure configure apps' language
, sourcelanguage
correctly if not done.
Comments
Post a Comment