mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-24 16:07:19 +01:00
Fixes #1870: Validation errors weren't properly translated when using clientside validation
This commit is contained in:
@@ -90,8 +90,8 @@ class RequiredValidator extends Validator
|
||||
{
|
||||
$options = [];
|
||||
if ($this->requiredValue !== null) {
|
||||
$options['message'] = strtr($this->message, [
|
||||
'{requiredValue}' => $this->requiredValue,
|
||||
$options['message'] = Yii::t('yii', $this->message, [
|
||||
'requiredValue' => $this->requiredValue,
|
||||
]);
|
||||
$options['requiredValue'] = $this->requiredValue;
|
||||
} else {
|
||||
@@ -101,8 +101,8 @@ class RequiredValidator extends Validator
|
||||
$options['strict'] = 1;
|
||||
}
|
||||
|
||||
$options['message'] = strtr($options['message'], [
|
||||
'{attribute}' => $object->getAttributeLabel($attribute),
|
||||
$options['message'] = Yii::t('yii', $options['message'], [
|
||||
'attribute' => $object->getAttributeLabel($attribute),
|
||||
]);
|
||||
|
||||
ValidationAsset::register($view);
|
||||
|
||||
Reference in New Issue
Block a user