Closed
Description
Can we add a paragraph in https://github.com/symfony/symfony-docs/blob/6.4/validation/translations.rst about how to translate with TranslatableMessage since it is out from Symfony 6.2 (blog)
Like so:
use Symfony\Component\Translation\TranslatableMessage;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
#[Assert\Callback]
public function validate(ExecutionContextInterface $context, mixed $payload): void
{
$context->buildViolation(new TranslatableMessage('author.name.not_blank', [], 'validators'))
->atPath('name')
->addViolation()
;
}