mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
fixed validation message translation [skip ci]
This commit is contained in:
@ -93,7 +93,7 @@ class CaptchaValidator extends Validator
|
|||||||
'hashKey' => 'yiiCaptcha/' . $this->captchaAction,
|
'hashKey' => 'yiiCaptcha/' . $this->captchaAction,
|
||||||
'caseSensitive' => $this->caseSensitive,
|
'caseSensitive' => $this->caseSensitive,
|
||||||
'message' => strtr($this->message, [
|
'message' => strtr($this->message, [
|
||||||
'{attribute}' => $object->getAttributeLabel($attribute),
|
'attribute' => $object->getAttributeLabel($attribute),
|
||||||
]),
|
]),
|
||||||
];
|
];
|
||||||
if ($this->skipOnEmpty) {
|
if ($this->skipOnEmpty) {
|
||||||
|
@ -151,7 +151,7 @@ class StringValidator extends Validator
|
|||||||
|
|
||||||
$options = [
|
$options = [
|
||||||
'message' => Yii::$app->getI18n()->format($this->message, [
|
'message' => Yii::$app->getI18n()->format($this->message, [
|
||||||
'{attribute}' => $label,
|
'attribute' => $label,
|
||||||
], Yii::$app->language),
|
], Yii::$app->language),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user