Skip to content

Commit ad0e940

Browse files
committed
Merge branch '7.4' into 8.0
* 7.4: [Validator] Mention how to disable validation translation in ConstraintViolationBuilderInterface
2 parents c39a52f + 4f80dfd commit ad0e940

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)