Skip to content

[Translation] Document lint:translations command #19959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ 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 and XLIFF
If you prefer, you can also validate the syntax of any YAML and XLIFF
translation file using the ``lint:yaml`` and ``lint:xliff`` commands:

.. code-block:: terminal
Expand Down Expand Up @@ -1384,6 +1384,22 @@ adapted to the format required by GitHub, but you can force that format too:

$ php vendor/bin/yaml-lint translations/

The ``lint:yaml`` and ``lint:xliff`` commands validate the YAML and XML syntax
of the translation files, but not their contents. Use the following command
to check that the translation contents are also correct:

.. code-block:: terminal

# checks the contents of all the translation catalogues in all locales
$ php bin/console lint:translations

# checks the contents of the translation catalogues for Italian (it) and Japanese (ja) locales
$ php bin/console lint:translations --locales=it --locales=ja

.. versionadded:: 7.2

The ``lint:translations`` command was introduced in Symfony 7.2.

Pseudo-localization translator
------------------------------

Expand Down
Loading