Yii::t From Source Language To Target Language!?

My config as below




'sourceLanguage'=>'en',

'language'=>'en',



And this works fine,




Yii::app()->language = 'zh';

echo Yii::t('general', 'test');



But this does not work!? I was expecting a zh translated word but it returns the english word.




echo Yii::t('general', 'test', 'en', 'zh'); // not working

echo Yii::t('general', 'test', 'zh', 'en'); // ditto



make sure to create a translation file for your language

There is already a translation file in place and working fine. With this code


Yii::app()->language = 'zh';

echo Yii::t('general', 'test');

I will get the zh version of the word.