-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Added documentation for translation:debug #3629
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
Changes from 1 commit
2d9647b
864b9f2
38b2955
b6ac454
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -649,6 +649,39 @@ The translation of database content should be handled by Doctrine through | |
the `Translatable Extension`_. For more information, see the documentation | ||
for that library. | ||
|
||
Debugging Translations | ||
---------------------- | ||
|
||
.. versionadded:: 2.5 | ||
The ``translation:debug`` command was introduced in Symfony 2.5. | ||
|
||
When maintaining a bundle, you may use or remove the usage of a translation | ||
message without updating all message catalogues. The ``translation:debug`` | ||
command helps you finding these missing or unused translation messages for a | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. helps you to find |
||
given locale. It shows you a table with the result when translating the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @florianv I really like this feature! To make it easier to understand (and use), I think we should show the first usage (so, the code-block you have below) right after "... given locale" AND I think we should include some sample output of what it might look like. Then, we can continue the descriptions you have here, but actually point out what we mean by referencing the sample output. What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @weaverryan |
||
message in the given locale and the result when the fallback would be used. | ||
On top of that, it also shows you when the translation is the same as the | ||
fallback translation (this could indicate that the message was not correctly | ||
translated). To inspect all messages in the ``en`` locale for the AcmeDemoBundle, run: | ||
|
||
.. code-block:: bash | ||
|
||
$ php app/console translation:debug en AcmeDemoBundle | ||
|
||
By default all domains are inspected, but it is possible to specify a single domain: | ||
|
||
.. code-block:: bash | ||
|
||
$ php app/console translation:debug en AcmeDemoBundle --domain=messages | ||
|
||
You can also display only the unused or only the missing messages, by using | ||
the ``--only-unused`` or ``--only-missing`` switches: | ||
|
||
.. code-block:: bash | ||
|
||
$ php app/console translation:debug en AcmeDemoBundle --only-unused | ||
$ php app/console translation:debug en AcmeDemoBundle --only-missing | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would combine these 2 examples: You can also display only the unused or only the missing messages, by using
the ``--only-unused`` or ``--only-missing`` switches:
.. code-block:: bash
$ php app/console translation:debug en AcmeDemoBundle --only-unused
$ php app/consoel translation:debug en AcmeDemoBundle --only-missing |
||
|
||
Summary | ||
------- | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a versionadded directive: