Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Added documentation for translation:debug
  • Loading branch information
florianv committed Mar 3, 2014
commit 2d9647b9e953dbd85fc1d0873eaa163505b97e82
33 changes: 33 additions & 0 deletions book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------------

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a versionadded directive:

Debugging Translations
----------------------

.. versionadded:: 2.5
    The ``translation:debug`` command was introduced in Symfony 2.5.

.. 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
Copy link
Member

Choose a reason for hiding this comment

The 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
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @weaverryan
I have added some screenshots and modified it so people can follow it like a tutorial.
Please let me know what you think.

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
Copy link
Member

Choose a reason for hiding this comment

The 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
-------

Expand Down