Skip to content

[FrameworkBundle] Added a translation:debug command #10076

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

Closed
wants to merge 1 commit into from

Conversation

florianv
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

This pull request adds a translation:debug command that can be used to inspect unused / missing messages and compare them with the fallback ones (for example to detect copy pasted strings). This is inspired by this ruby project https://github.com/glebm/i18n-tasks

Example of output:

demo

@jakzal
Copy link
Contributor

jakzal commented Jan 19, 2014

👍 very nice idea

@stof
Copy link
Member

stof commented Jan 19, 2014

I see several issues with this command:

  • listing all translation of the project is likely to be totally unusable. When you have hundreds of translation strings, finding the 2 missing translations in the middle will be impossible
  • using a table for the display is likely to be a broken output easily, because translations can be long strings (and even multiline ones)

May I point you to https://github.com/Incenteev/IncenteevTranslationCheckerBundle which implement a few commands to check translations (only 2 at the moment, but more are planned) ?

@florianv
Copy link
Contributor Author

@stof you can pass --only-missing or --only-unused too. Thanks I was not aware of this bundle.

@florianv
Copy link
Contributor Author

As per @stof comment I sanitized and truncated (limited to 40 chars) the messages so they can be previewed without breaking the output (the most important informations being the state and id)

The <info>%command.name%</info> command helps finding unused or missing translation messages and
comparing them with the fallback ones by inspecting the templates and translation files of a given bundle.

You can display informations about a bundle translations in a specific locale:
Copy link
Member

Choose a reason for hiding this comment

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

information

@cordoval
Copy link
Contributor

cordoval commented Mar 3, 2014

I see no added tests or docu PR

@fabpot
Copy link
Member

fabpot commented Mar 3, 2014

I've fixed a bunch of small edge cases on top of this PR. See #10368

@fabpot fabpot closed this Mar 3, 2014
fabpot added a commit that referenced this pull request Mar 3, 2014
…abpot)

This PR was merged into the 2.5-dev branch.

Discussion
----------

[FrameworkBundle] Added a translation:debug command

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

This PR is based on #10076 but fixes a bunch of issues for edge cases. It also uses the new Table helper.

Original description:

This pull request adds a `translation:debug` command that can be used to inspect unused / missing messages and compare them with the fallback ones (for example to detect copy pasted strings). This is inspired by this ruby project https://github.com/glebm/i18n-tasks

Example of output:

![image](https://f.cloud.github.com/assets/47313/2311673/84ae301c-a2f3-11e3-8bf6-96034369e46c.png)

Commits
-------

f039bde [FrameworkBundle] fixed edge cases for translation:debug and tweaked the output
597a310 Added a translation:debug command
@florianv florianv deleted the translation-debug branch March 4, 2014 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants