mahan Posted March 8, 2012 Share Posted March 8, 2012 I created a simple component in my Yii project and there is a text on it that needs to be translated using i18n feature of Yii class MySimpleComponent{ public static function WelcomeCurrentUser(){ $wuser = Yii::t("lstrings","Welcome back "); $wuser .= Yii::app()->session['curuser']; return $wuser; } } I invoke that small component function in one of my views. echo MySimpleComponent::WelcomeCurrentUser(); but as i change the language in one of my controllers using the following code Yii::app()->language = 'ja' //change language to japanese the translation doesn't work... I double check my i18n strings to ensure that messages are exact to each other and still doesn't work. this is my lstrings.php file return array("Hello"=>"こんにちは", "Welcome back "=>"お帰りなさい", ); Any ideas why the translation does not work? any solutions? thanks Link to comment Share on other sites More sharing options...
Larry Posted March 9, 2012 Share Posted March 9, 2012 What does "the translation doesn't work" mean? Does the English get shown? Does nothing get shown? Does the computer eject the CD? You need to be more specific. Link to comment Share on other sites More sharing options...
Recommended Posts