8000 [DX] Minor improvement for the translation:debug output · Issue #13874 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DX] Minor improvement for the translation:debug output #13874

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
javiereguiluz opened this issue Mar 9, 2015 · 15 comments
Closed

[DX] Minor improvement for the translation:debug output #13874

javiereguiluz opened this issue Mar 9, 2015 · 15 comments
Labels
DX DX = Developer eXperience (anything that improves the experience of using Symfony) Good first issue Ideal for your first contribution! (some Symfony experience may be required) Translation

Comments

@javiereguiluz
Copy link
Member

Currently, translation:debug output uses a legend to show the state of each translation. Example:

+----------+----------------------------------------+------------------------------------------+
| State(s) | Id                                     | Message Preview (en)                     |
+----------+----------------------------------------+------------------------------------------+
| o        | what.is.component                      | What is a Component?                     |
| =        | the.components                         | The Components                           |
| o        | browserkit.summary                     | Simulates the behavior of a web browser. |
| x        | browserkit.description                 |                                          |
| o        | classloader.summary                    | Loads your project classes automatica... |
| x        | classloader.description                |                                          |
| ...                                                                                          |
+----------+----------------------------------------+------------------------------------------+

Legend:
 x Missing message
 o Unused message
 = Same as the fallback message

I find the legend confusing when the table is very long, which is usually the case. Moreover, the State column is wide enough to not use a legend and just display the labels.

That's why I propose to change this table a bit to look as follows:

+----------+----------------------------------------+------------------------------------------+
| State    | Id                                     | Message Preview (en)                     |
+----------+----------------------------------------+------------------------------------------+
| unused   | what.is.component                      | What is a Component?                     |
| same     | the.components                         | The Components                           |
| unused   | browserkit.summary                     | Simulates the behavior of a web browser. |
| missing  | browserkit.description                 |                                          |
| unused   | classloader.summary                    | Loads your project classes automatica... |
| missing  | classloader.description                |                                          |
| ...                                                                                          |
+----------+----------------------------------------+------------------------------------------+
@jakzal
Copy link
Contributor
jakzal commented Mar 9, 2015

I don't have a preference, but if we proceed "equal" should be "same".

@javiereguiluz
Copy link
Member Author

@jakzal thanks. I've replaced equal by same.

@xabbuh
Copy link
Member
xabbuh commented Mar 9, 2015

I'm not sure if same is easy to understand if you don't know the context. What about something like "not modified" or "not adapted"?

@jakzal
Copy link
Contributor
jakzal commented Mar 9, 2015

Either "not modified" nor "not adapted" are correct. The message is set to the same value as the fallback message, no?

@jakzal
Copy link
Contributor
jakzal commented Mar 9, 2015

How about "fallback"?

@xabbuh
Copy link
Member
xabbuh commented Mar 9, 2015

Yes, but this may indicate that you copied the translation file for the fallback language and forgot to translate one if the values. I have to any that this is not the only reason this happens though.

@xabbuh
Copy link
Member
xabbuh commented Mar 9, 2015

"fallback" sounds good. "default" could also be an option.

@timglabisch
Copy link

👍

@javiereguiluz
Copy link
Member Author

Let's recap this proposal:

1) If Symfony deciders don't like this idea, please close this issue as won't fix. Thanks.

2) If the idea is accepted, let's tag it as Easy Pick, because this is the ideal issue for someone who wants to submit his/her first pull request to Symfony.

The work to do is to replace the bottom "icon" legend by text labels inside the table:

+----------+----------------------------------------+------------------------------------------+
| State    | Id                                     | Message Preview (en)                     |
+----------+----------------------------------------+------------------------------------------+
| unused   | what.is.component                      | What is a Component?                     |
| fallback | the.components                         | The Components                           |
| unused   | browserkit.summary                     | Simulates the behavior of a web browser. |
| missing  | browserkit.description                 |                                          |
| unused   | classloader.summary                    | Loads your project classes automatica... |
| missing  | classloader.description                |                                          |
| ...                                                                                          |
+----------+----------------------------------------+------------------------------------------+

Labels are color-coded as follows:

  • fallback in the green color displayed by the <info> console tag
  • missing in red used for errors
  • unused in the yellow/orange color displayed by the <comment> console tag

@stof stof added the DX DX = Developer eXperience (anything that improves the experience of using Symfony) label Mar 11, 2015
@stof
Copy link
Member
stof commented Mar 11, 2015

I agree it would be easier to understand. I vote for tagging as Easy-pick

@skafandri
Copy link
Contributor

I added an explicit-state optional argument. The reason: we have some bash scripts that run translation:debug command and parses the output to send us some notifications or run some other scripts, so being able to keep the old output format would be nice to other people parsing the command output.

@xabbuh
Copy link
Member
xabbuh commented Mar 24, 2015

@skafandri Does it make sense to add a dedicated format for such parsers (like XML or YAML)?

@skafandri
Copy link
Contributor

@xabbuh Absolutely, the problem is that this command (among others) doesn't support the --format option. As a future improvement, it would be nice that all commands supports the --format option. For the actual case, is not only the format (currently being parsed with a regex) but the expected values.
I don't see any problem keeping the old display style intact while adding a new option.

@javiereguiluz
Copy link
Member Author

@skafandri I understand that you need to maintain the old behavior of the command for BC reasons. But introducing an option just to tweak the output of the command looks wrong to me. What about postponing these changes for Symfony 3.0?

@skafandri
Copy link
Contributor

@javiereguiluz If this will be postponed to Symfony 3.0 then I would not be happy with this change because what I did here is kind of hackish :)
I suggest to have a base abstract command that abstracts common behaviours and provide helpers for output formatting (I know that they are already some helpers but I am referring to more powerful ones) the way JQgrid or most Java Swing components works.
If you like the concept, I can develop further my idea.

@aitboudad aitboudad added the Good first issue Ideal for your first contribution! (some Symfony experience may be required) label Apr 26, 2015
@fabpot fabpot closed this as completed Apr 27, 2015
fabpot added a commit that referenced this issue Apr 27, 2015
…(nicolasdewez)

This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #14473).

Discussion
----------

[DX] Minor improvement for the translation:debug output

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #13874

Commits
-------

6970469 Changed output for translation:debug command
aitboudad added a commit that referenced this issue Apr 29, 2015
…t (nicolasdewez)

This PR was submitted for the master branch but it was merged into the 2.8 branch instead (closes #14473).

Discussion
----------

[DX] Minor improvement for the translation:debug output

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #13874

Commits
-------

b941bd3 Changed output for translation:debug command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX DX = Developer eXperience (anything that improves the experience of using Symfony) Good first issue Ideal for your first contribution! (some Symfony experience may be required) Translation
Projects
None yet
Development

No branches or pull requests

8 participants
0