How to use Yii::t() in module

Hi all,

I have call some modules in my page and i would i like to use Yii::t() from the module, i have try to normal ways but it is not working.




Yii::t('favouriteStore', 'BTN_SAVE')



if the message file is from my modules, how do i write the Yii::t()?

You need to reference the module name, so say you have a Page module(/modules/page) and your translation for that module is located in /modules/page/messages/LNG/page.php, you will call Yii translation like:




Yii::t('PageModule.page', 'string to be translated');



Basically, the signature is:




Yii::t('ModuleNameModule.fileWhereTheTranslationCanBeFound', 'string to be translated');



Thanks twisted1919, it work fine for me.