custom form error messages in yii

how do i customise the error messages in the yii login form

currently i get messages like

"Password is too short (minimum is 6 characters)"

I would like to have it in a different language.

Did you select an application language of your choice?

In config




<?php

return array(

  'language' => '<your language code>',

  ...

)



Dynamically (e.g in a base controller)




Yii::app()->setLanguage('<your language code>')



See http://www.yiiframework.com/doc/guide/topics.i18n

/Tommy

Also refer to: http://www.yiiframework.com/doc/cookbook/1/

thanks qiang, i have found it already :) (couple of hours ago)

ive also been looking at http://www.yiiframework.com/doc/cookbook/18/

can i ask you one simple thing?

im trying to sort out the translation and modify the default messages (starting with the english one)

in what file are the default english messages stored?

i mean i know i need to copy the files from yii/framework/messages to private/messages but which one of the lang folders contains the default messages? or are they somewhere else?

or do i need to add another language called "en", and add the lines (for example) like this:


  '{attribute} cannot be blank.' => '{attribute} cannot be blank.',

to it? but wouldn’t that be too much repeating text?

im completely new to frameworks, so its very hard to digest it all, but i chose to work with yii because it looked like the most advanced framework.