File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ .. index ::
2
+ single: Translation; Lint
3
+ single: Translation; Translation File Errors
4
+
5
+ How to Find Errors in Translation Files
6
+ =======================================
7
+
8
+ Symfony processes all the application translation files as part of the process
9
+ that compiles the application code before executing it. If there's an error in
10
+ any translation file, you'll see an error message explaining the problem.
11
+
12
+ If you prefer, you can also validate the contents of any YAML and XLIFF
13
+ translation file using the ``lint:yaml `` and ``lint:xliff `` commands:
14
+
15
+ .. code-block :: terminal
16
+
17
+ # lint a single file
18
+ $ ./bin/console lint:yaml app/Resources/translations/messages.en.yml
19
+ $ ./bin/console lint:xliff app/Resources/translations/messages.en.xlf
20
+
21
+ # lint a whole directory
22
+ $ ./bin/console lint:yaml app/Resources/translations
23
+ $ ./bin/console lint:xliff app/Resources/translations
24
+
25
+ # lint a specific bundle
26
+ $ ./bin/console lint:yaml @AppBundle
27
+ $ ./bin/console lint:xliff @AppBundle
28
+
29
+ The linter results can be exported to JSON using the ``--format `` option:
30
+
31
+ .. code-block :: terminal
32
+
33
+ # lint a single file
34
+ $ ./bin/console lint:yaml app/Resources/translations --format=json
35
+ $ ./bin/console lint:xliff app/Resources/translations --format=json
You can’t perform that action at this time.
0 commit comments