Skip to content

[FrameworkBundle] Applied new styles to translation commands #14595

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

Merged
merged 1 commit into from
May 20, 2015
Merged

[FrameworkBundle] Applied new styles to translation commands #14595

merged 1 commit into from
May 20, 2015

Conversation

ogizanagi
Copy link
Contributor

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

Translation debug

Only the table layout and deprecation note is changed

screenshot 2015-05-09 a 17 09 17
screenshot 2015-05-09 a 17 13 47

Translation update

Before:

screenshot 2015-05-09 a 17 15 51

After:

screenshot 2015-05-09 a 17 03 59
screenshot 2015-05-09 a 17 04 35
screenshot 2015-05-09 a 17 05 06
screenshot 2015-05-09 a 17 06 07

@ogizanagi
Copy link
Contributor Author

Fabbot report had no relation with the purpose of this PR. But in case it would be appreciated, it's fixed, could be squashed, or reverted on demand.

if (false !== strpos($input->getFirstArgument(), ':d')) {
$output->writeln('<comment>The use of "translation:debug" command is deprecated since version 2.7 and will be removed in 3.0. Use the "debug:translation" instead.</comment>');
$output->newLine();
Copy link
Contributor

Choose a reason for hiding this comment

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

write and then add a new line

Copy link
Contributor

Choose a reason for hiding this comment

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

could you remove all unnecessary newLine calls, as the new SymfonyStyle handle this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, all those newLine calls are here in order to have the command output preceded and followed by 1 blank line, to increase readability and separate output of different commands, which is not fully handled by SymfonyStyle.
Do you still want me to remove them ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think so, if there is a such case why not improving SymfonyStyle instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, you're right. I didn't dig into this problem for now but I'm not sure that's as trivial as it seems.
I'll update this PR as you advised me right now.

@aitboudad
Copy link
Contributor

use $output->text($outputMessage); warning in TranslationDebugCommand.php#L145

@aitboudad
Copy link
Contributor

👍

@xabbuh
Copy link
Member

xabbuh commented May 12, 2015

@ogizanagi Can you please rebase to (hopefully) trigger a successful build?

@ogizanagi
Copy link
Contributor Author

@xabbuh : Sure. It's done. Let's see if Travis is happy :)

@@ -85,8 +85,9 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$output = new SymfonyStyle($input, $output);
Copy link
Member

Choose a reason for hiding this comment

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

Imho we should choose another name here and not override one of the method arguments.

Copy link
Contributor

Choose a reason for hiding this comment

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

It was already mentioned here #14132 (comment) but I'm not sure about it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, I don't know. We started this debate over here: #14132 (comment), but no result for now.

I'm not convinced, as SymfonyStyle acts as a pseudo-decorator, and fully replace the output for the whole command (IMO it's even better, by avoiding using the non-decorated output by error and "mix styles").


Edit: aitboudad was faster :)

@fabpot
Copy link
Member

fabpot commented May 20, 2015

Thank you @ogizanagi.

@fabpot fabpot merged commit 812fedc into symfony:2.7 May 20, 2015
fabpot added a commit that referenced this pull request May 20, 2015
…ands (ogizanagi)

This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Applied new styles to translation commands

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

## Translation debug

_Only the table layout and deprecation note is changed_

![screenshot 2015-05-09 a 17 09 17](https://cloud.githubusercontent.com/assets/2211145/7550802/45f9a53c-f670-11e4-8e33-6ec9de973c99.PNG)
![screenshot 2015-05-09 a 17 13 47](https://cloud.githubusercontent.com/assets/2211145/7551396/d57523e2-f686-11e4-907c-8b4183183ee1.PNG)

## Translation update

### Before:

![screenshot 2015-05-09 a 17 15 51](https://cloud.githubusercontent.com/assets/2211145/7550791/06cee3a4-f670-11e4-80f1-320e2768290c.PNG)

### After:

![screenshot 2015-05-09 a 17 03 59](https://cloud.githubusercontent.com/assets/2211145/7550797/45f3baaa-f670-11e4-9beb-ad6c6b10442c.PNG)
![screenshot 2015-05-09 a 17 04 35](https://cloud.githubusercontent.com/assets/2211145/7550799/45f7ed64-f670-11e4-9b77-9b602ea2920b.PNG)
![screenshot 2015-05-09 a 17 05 06](https://cloud.githubusercontent.com/assets/2211145/7550800/45f97904-f670-11e4-8b60-c73095b74800.PNG)
![screenshot 2015-05-09 a 17 06 07](https://cloud.githubusercontent.com/assets/2211145/7550798/45f6508a-f670-11e4-9c21-7247691df985.PNG)

Commits
-------

812fedc [FrameworkBundle] Applied new styles to translation commands
@ogizanagi ogizanagi deleted the trans_style branch May 20, 2015 08:24
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.

4 participants