File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 44How to Translate Validation Constraint Messages
55===============================================
66
7- If you're using validation constraints with the Form component, you can translate
8- the error messages by creating a translation resource for the
9- `` validators `` :ref: `domain <translation-resource-locations >`.
7+ The validation constraints used in forms can translate their error messages by
8+ creating a translation resource for the `` validators ``
9+ :ref: `translation domain <translation-resource-locations >`.
1010
11- .. note ::
11+ First of all, install the Symfony translation component (if it's not already
12+ installed in your application) running the following command:
1213
13- In order to translate the error message, you should have installed the
14- symfony/translation component with Composer.
14+ .. code-block :: terminal
1515
16- To start, suppose you've created a plain-old-PHP object that you need to
17- use somewhere in your application::
16+ $ composer require symfony/translation
17+
18+ Suppose you've created a plain-old-PHP object that you need to use somewhere in
19+ your application::
1820
1921 // src/Entity/Author.php
2022 namespace App\Entity;
You can’t perform that action at this time.
0 commit comments