Custom Validation Rules And Translate Error Meesage

How can i translate this message in any languate.

My Validation Rule.


array("password","validatePassword"),

My Model Function for custom validation


public function validatePassword($attribute,$params){


        //$this->addError($attribute, 'Password cannot be blank'.$this->person_type);

        if(empty($this->password) && $this->person_type == "user"){

            $this->addError($attribute, Yii::t(LANG, "Password cannot be blank."));

        }




    }

Try




$this->addError($attribute, Yii::t('yii','{attribute} cannot be blank.'));



The validator will replace {attribute} with the attribute label on addError.

The ‘{attribute} cannot be blank.’ is known by yii, see the messages files in the Yii framework/messages folder.

help your self

http://www.yiiframework.com/doc/guide/1.1/en/topics.i18n