How to create a multilanguage label in Yii
internationalization, multilingual, php, yii
Solution
Yii doesn't translate it automatically. You need to use the i18n built-in in Yii and manually add the translations and modify the labels as follow:
public function attributeLabels() {
return array(
'email' => Yii::t('account','Email address'),
'rememberMe' => Yii::t('account','Remember me next time'),
'password' => Yii::t('account','Password')
);
}
You can get more info about internationalize you app at Quick Start to Internationalize your application in Yii Framework
Problem
I am wondering if the Yii framework uses the defined Labels atttributes in a multilanguage process. So if I have ``` public function attributeLabels() { return array( 'email' => 'Email address', 'rememberMe' => 'Remember me next time', 'password' => 'Password' ); } ``` Will this be translated to some other language? Or do I have to do something manually to work?