Skip to content

Commit dbc7a2b

Browse files
committed
[Validation] Mention how to disable validation translation in ConstraintViolationBuilderInterface
1 parent f5af7bd commit dbc7a2b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

validation/custom_constraint.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,17 @@ message as its argument and returns an instance of
180180
:class:`Symfony\\Component\\Validator\\Violation\\ConstraintViolationBuilderInterface`.
181181
The ``addViolation()`` method call finally adds the violation to the context.
182182

183+
.. tip::
184+
185+
Validation error messages are automatically passed to the Symfony
186+
Translation component. If your application doesn't use translations, you
187+
can disable this behavior by calling the ``disableTranslation()`` method
188+
of ``ConstraintViolationBuilderInterface``.
189+
190+
.. versionadded:: 6.4
191+
192+
The ``disableTranslation()`` method was introduced in Symfony 6.4.
193+
183194
Using the new Validator
184195
-----------------------
185196

0 commit comments

Comments
 (0)