Alexander Borisov

Results 48 comments of Alexander Borisov

If it's a single language app then you must set this language for translator in the configuration so you get expected message

> Yes. But for translator language of original messages is English, but custom original messages in app on Russian. Custom messages you write in Russian, validator build-in messages are translated...

> with translator original language (english) Why it's english if app's locale is russian?

But there is [translation](https://github.com/yiisoft/validator/blob/master/messages/ru/yii-validator.php#L56) for this message. It wouldn't be translated?

How this example may be implemented with `Callback` rule?

Something like this? ```php /** * @var array */ private readonly array $categories; #[Callback(method: categoryIdRule)] public int|null $categoryId = null; private function categoryIdRule(mixed $value, RuleInterface $rule, ValidationContext $context): Result {...

I'm not sure this worth it. It only removes `$context->validate($value` part