Try this
Add this in your config/main.php in components array.
'messages' => array(
'onMissingTranslation' => array('MessageHelper', 'textMissingTranslation'),
),
Create a file MessageHelper.php in components and add the below code in it
class MessageHelper
{
public static function textMissingTranslation($event)
{
$var = include( Yii::getPathOfAlias( 'application.messages.en.main').'.php' );
return $event->message = $var[$event->message];
}
}