I have a problem with validation error messages, when using yii::t() with a translation file. I have the attribute labels array set to load the name of the attribute from the file and that works like intented, in the forms it shows the message perfectly, except when a validation error happens, in which case the error message shows the key not the message.
Example:
Nombre
<input text>
errorMessage: "pageName.lblNameField cannot be blank."
Thanks a lot Ankit, setting the language directly in the config/main file did quite solve that issue, of loading the attribute labels correctly when a validation error occurred. But it brings me to another one, i’m setting the language at page load through Yii::app()->setLanguage( Yii::app()->getRequest()->getPreferredLanguage() ). In wich case i still have the same problem as before, it doesnt load the attribute labels in validation error messages.
Is there any other way i could specify the language dinamically from browser? or any other way to set language?