When translating strings in Yii with GetText, do we have to use Yii::t($category,\'message\')
or gettext\'s _(\'message\')
syntax?
And then how
You need to use Yii::t() for translations. with the inbuilt yiic message
command you can generate all the text in to language file.
Example-
Yii::t('app', 'Hello World');
Yii::t('email', 'Welcome');
This will generate 2 files app.php and email.php inside your messages directory. messages/en/app.php & messages/en/email.php
please find more info about Yii translations here
https://www.yiiframework.com/doc/guide/2.0/en/tutorial-i18n https://www.yiiframework.com/doc/guide/1.1/en/topics.i18n