WARNING:
You are browsing the documentation for Symfony 2.7 which is not maintained anymore.
Consider upgrading your projects to Symfony 5.2.
How to Find Errors in Translation Files
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:
1 2 3 4 5 6 7 8 | # lint a single file
$ ./app/console lint:yaml app/Resources/translations/messages.en.yml
# lint a whole directory
$ ./app/console lint:yaml app/Resources/translations
# lint a specific bundle
$ ./app/console lint:yaml @AppBundle
|
The linter results can be exported to JSON using the --format
option:
1 2 | # lint a single file
$ ./app/console lint:yaml app/Resources/translations --format=json
|
This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.