Skip to content

Commit 2a14385

Browse files
committed
Merge branch '6.4' into 7.2
* 6.4: [Validator] Mention how to disable validation translation in ConstraintViolationBuilderInterface
2 parents d04ddec + 04d5a37 commit 2a14385

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

validation/custom_constraint.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ message as its argument and returns an instance of
176176
:class:`Symfony\\Component\\Validator\\Violation\\ConstraintViolationBuilderInterface`.
177177
The ``addViolation()`` method call finally adds the violation to the context.
178178

179+
.. tip::
180+
181+
Validation error messages are automatically translated to the current application
182+
locale. If your application doesn't use translations, you can disable this behavior
183+
by calling the ``disableTranslation()`` method of ``ConstraintViolationBuilderInterface``.
184+
185+
.. versionadded:: 6.4
186+
187+
The ``disableTranslation()`` method was introduced in Symfony 6.4.
188+
179189
Using the new Validator
180190
-----------------------
181191

0 commit comments

Comments
 (0)