Skip to content

Commit 2d9647b

Browse files
committed
Added documentation for translation:debug
1 parent cadca3b commit 2d9647b

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

book/translation.rst

+33
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,39 @@ The translation of database content should be handled by Doctrine through
649649
the `Translatable Extension`_. For more information, see the documentation
650650
for that library.
651651

652+
Debugging Translations
653+
----------------------
654+
655+
.. versionadded:: 2.5
656+
The ``translation:debug`` command was introduced in Symfony 2.5.
657+
658+
When maintaining a bundle, you may use or remove the usage of a translation
659+
message without updating all message catalogues. The ``translation:debug``
660+
command helps you finding these missing or unused translation messages for a
661+
given locale. It shows you a table with the result when translating the
662+
message in the given locale and the result when the fallback would be used.
663+
On top of that, it also shows you when the translation is the same as the
664+
fallback translation (this could indicate that the message was not correctly
665+
translated). To inspect all messages in the ``en`` locale for the AcmeDemoBundle, run:
666+
667+
.. code-block:: bash
668+
669+
$ php app/console translation:debug en AcmeDemoBundle
670+
671+
By default all domains are inspected, but it is possible to specify a single domain:
672+
673+
.. code-block:: bash
674+
675+
$ php app/console translation:debug en AcmeDemoBundle --domain=messages
676+
677+
You can also display only the unused or only the missing messages, by using
678+
the ``--only-unused`` or ``--only-missing`` switches:
679+
680+
.. code-block:: bash
681+
682+
$ php app/console translation:debug en AcmeDemoBundle --only-unused
683+
$ php app/console translation:debug en AcmeDemoBundle --only-missing
684+
652685
Summary
653686
-------
654687

0 commit comments

Comments
 (0)