如何将表单验证提示弄成中文的

比如 有以下代码显示一个表单,model添加了email的rules:

<?php $form=$this->beginWidget(‘CActiveForm’, array(

'id'=&gt;'form',


'enableAjaxValidation'=&gt;false,

)); ?>

<?php echo $form->errorSummary($model); ?>

<div class="row">

	&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'email'); ?&gt;


	&lt;?php echo &#036;form-&gt;textField(&#036;model,'email',array('size'=&gt;60,'maxlength'=&gt;255)); ?&gt;


	&lt;?php echo &#036;form-&gt;error(&#036;model,'email'); ?&gt;

</div>

<div class="row buttons">

	&lt;?php echo CHtml::submitButton(&#036;model-&gt;isNewRecord ? 'Create' : 'Save'); ?&gt;

</div>

<?php $this->endWidget(); ?>

如果邮箱格式有误,会出现提示至 $form->errorSummary($model) 和 $form->error($model, ‘email’)中,但是提示为英文,如何将这两处的错误提示改成中文的呢?

我在文档中没找到关于这比分的内容,哪位大侠指导我下

这个需要修改你的模型类的验证规则,如下:

public function rules()

{

return array(

array('username, password, verifyCode', 'required','message'=&gt;iconv(&quot;gb2312&quot;,&quot;utf-8&quot;,&quot;不能为空&quot;)),


array('username', 'authenticate'),


array('verifyCode', 'captcha'),

);

}

当然了,这是我的代码,呵呵!你应该能够看明白的!

你将main.php里的app配置加上language=>‘zh_cn’,系统默认的提示就是中文的了,要自定义消息就像楼上说的定义message

但是如果是多语言呢?就是说有三种语言:比如说 简体中文,繁体中文,英文 ,好像只有在中文简体下:‘Please fix the following input errors:’才会显示中文,而在繁体中文下,‘Please fix the following input errors:’还是显示成英文??

请问是什么原因???谢谢…