8000 Added a new short article about linting translation files · symfony/symfony-docs@df7841b · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit df7841b

Browse files
javiereguiluzxabbuh
authored andcommitted
Added a new short article about linting translation files
1 parent b8da0dd commit df7841b

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

translation/lint.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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

0 commit comments

Comments
 (0)
0