Sergei Predvoditelev

Results 276 comments of Sergei Predvoditelev

> 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...

> Custom messages you write in Russian, validator build-in messages are translated to Russian from English because you set Russian locale No. Translator tried translate to russian, but it not...

> Why it's english if app's locale is russian? Default messages in English ([example](https://github.com/yiisoft/validator/blob/master/src/Rule/Email.php#L98)), so for translator original language is english.

This suggestion sounds logically. I like it. Breadcrumbs [example](https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/examples/breadcrumb/) in WAI-ARIA specification also uses `ol` tag. But this is BC-break change, so I suggest finish (add changelog and fix tests)...

@Sakhnovkrg It is not necessary to use force push. Many commits in PR is OK, we are squash them on merge.

> How this example may be implemented with `Callback` rule? Only with manual validation in `categoryIdRule` method

> Is it bad? It's not convenient

> Something like this? > > /** > * @var array > */ > private readonly array $categories; > > #[Callback(method: categoryIdRule)] > public int|null $categoryId = null; > >...

Callable for `Callback`: ```php private function categoryIdRule(mixed $value, RuleInterface $rule, ValidationContext $context): Result { return $context->validate($value, new In(array_keys($this->categories))); } ``` Callable for `CallbackRule`: ```php private function categoryIdRule(): RuleInterface { return...

~Same behavior with `Closure`: https://psalm.dev/r/0f016891bd~