From bd97f70965a6bd5c0fb791e9b4ef1626763760a0 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 15 Apr 2017 15:31:40 +0200 Subject: [PATCH] Added a new article about linting translation files --- translation/lint.rst | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 translation/lint.rst diff --git a/translation/lint.rst b/translation/lint.rst new file mode 100644 index 00000000000..af1cbdf3fb9 --- /dev/null +++ b/translation/lint.rst @@ -0,0 +1,31 @@ +.. index:: + single: Translation; Lint + single: Translation; Translation File Errors + +How to Find Errors in Translation Files +======================================= + +Symfony processes all the application translation files as part of the process +that compiles the application code before executing it. If there's an error in +any translation file, you'll see an error message explaining the problem. + +If you prefer, you can also validate the contents of any YAML translation file +using the ``lint:yaml`` command: + +.. code-block:: terminal + + # lint a single file + $ ./bin/console lint:yaml app/Resources/translations/messages.en.yml + + # lint a whole directory + $ ./bin/console lint:yaml app/Resources/translations + + # lint a specific bundle + $ ./bin/console lint:yaml @AppBundle + +The linter results can be exported to JSON using the ``--format`` option: + +.. code-block:: terminal + + # lint a single file + $ ./bin/console lint:yaml app/Resources/translations --format=json