Skip to content

Commit 78b3c10

Browse files
committed
minor #7801 Added a new article about linting translation files (javiereguiluz)
This PR was merged into the 2.7 branch. Discussion ---------- Added a new article about linting translation files This continues #7618 with a simpler article aimed at 2.7 -> 3.2. **Don't merge it up to master** because there's a more complete version of this article. Commits ------- bd97f70 Added a new article about linting translation files
2 parents 40bf456 + bd97f70 commit 78b3c10

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

translation/lint.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 translation file
13+
using the ``lint:yaml`` command:
14+
15+
.. code-block:: terminal
16+
17+
# lint a single file
18+
$ ./bin/console lint:yaml app/Resources/translations/messages.en.yml
19+
20+
# lint a whole directory
21+
$ ./bin/console lint:yaml app/Resources/translations
22+
23+
# lint a specific bundle
24+
$ ./bin/console lint:yaml @AppBundle
25+
26+
The linter results can be exported to JSON using the ``--format`` option:
27+
28+
.. code-block:: terminal
29+
30+
# lint a single file
31+
$ ./bin/console lint:yaml app/Resources/translations --format=json

0 commit comments

Comments
 (0)