Skip to content

Commit c4a398e

Browse files
authored
[Validator][Translation] Mention symfony/translation
1 parent 238a943 commit c4a398e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

validation/translations.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ If you're using validation constraints with the Form component, you can translat
88
the error messages by creating a translation resource for the
99
``validators`` :ref:`domain <translation-resource-locations>`.
1010

11+
.. note::
12+
13+
In order to translate the error message, you should have installed the
14+
symfony/translation component with Composer.
15+
1116
To start, suppose you've created a plain-old-PHP object that you need to
1217
use somewhere in your application::
1318

@@ -93,7 +98,7 @@ Now, create a ``validators`` catalog file in the ``translations/`` directory:
9398

9499
.. code-block:: xml
95100
96-
<!-- translations/validators.en.xlf -->
101+
<!-- translations/validators/validators.en.xlf -->
97102
<?xml version="1.0"?>
98103
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
99104
<file source-language="en" datatype="plaintext" original="file.ext">
@@ -108,12 +113,12 @@ Now, create a ``validators`` catalog file in the ``translations/`` directory:
108113
109114
.. code-block:: yaml
110115
111-
# translations/validators.en.yaml
116+
# translations/validators/validators.en.yaml
112117
author.name.not_blank: Please enter an author name.
113118
114119
.. code-block:: php
115120
116-
// translations/validators.en.php
121+
// translations/validators/validators.en.php
117122
return [
118123
'author.name.not_blank' => 'Please enter an author name.',
119124
];

0 commit comments

Comments
 (0)