fixed validation message translation [skip ci]

This commit is contained in:
Qiang Xue
2014-02-08 18:19:42 -05:00
parent c811a883a4
commit 928df00951
2 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,7 @@ class CaptchaValidator extends Validator
'hashKey' => 'yiiCaptcha/' . $this->captchaAction,
'caseSensitive' => $this->caseSensitive,
'message' => strtr($this->message, [
'{attribute}' => $object->getAttributeLabel($attribute),
'attribute' => $object->getAttributeLabel($attribute),
]),
];
if ($this->skipOnEmpty) {

View File

@ -151,7 +151,7 @@ class StringValidator extends Validator
$options = [
'message' => Yii::$app->getI18n()->format($this->message, [
'{attribute}' => $label,
'attribute' => $label,
], Yii::$app->language),
];