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

Skip to content

[Translation] added an --all option to the debug:translation command #14237 #14320

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

sgehrig
Copy link
Contributor

@sgehrig sgehrig commented Apr 11, 2015

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #14237
License MIT
Doc PR -
  • submit changes to the documentation

This PR adds an --all option the debug:translation command to enable debugging translations in all registered bundles AND the app directory.

$loader = $this->getContainer()->get('translation.loader');
$kernel = $this->getContainer()->get('kernel');
/** @var TranslationLoader $loader */
$loader = $this->getContainer()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why add line break here ? we can do $loader = $this->getContainer()->get('translation.loader');

@sgehrig sgehrig force-pushed the ticket_14237 branch 3 times, most recently from b388239 to 38cb884 Compare April 11, 2015 17:25
}
}
} elseif ($input->getArgument('all')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

it should be $input->getOption('all')

new InputOption('only-missing', null, InputOption::VALUE_NONE, 'Displays only missing messages'),
new InputOption('only-unused', null, InputOption::VALUE_NONE, 'Displays only unused messages'),
))
->setAliases(
Copy link
Contributor

Choose a reason for hiding this comment

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

->setAliases(array(

private function loadFallbackCatalogues($locale, $translationsPath, TranslationLoader $loader)
{
$fallbackCatalogues = array();
$translator = $this->getContainer()->get('translator');
Copy link
Contributor

Choose a reason for hiding this comment

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

remove extra spaces $translator =

@@ -40,14 +42,19 @@ protected function configure()
$this
->setName('debug:translation')
->setAliases(array(
'translation:debug',
'translation:debug',
Copy link
Contributor

Choose a reason for hiding this comment

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

remove indent

@sgehrig sgehrig force-pushed the ticket_14237 branch 2 times, most recently from 664d1ab to 9ae342d Compare April 11, 2015 17:53
}
$table->setHeaders($headers);
/** @var \Symfony\Component\Console\Helper\Table $table */
$table = new Table($output);
Copy link
Member

Choose a reason for hiding this comment

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

You need to fall back to TableHelper when the Console component is previous to 2.4.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That hasn't changed from the previous implementation. I'm not fully aware of release processes and required BC compatibility in Symphony, but as this is a 2.7 (or rather 2.8 - see @fabpot's comment below) feature, I don't think a compatibility with Console 2.4 is relevant here.
@aitboudad?

Copy link
Contributor

Choose a reason for hiding this comment

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

@sgehrig use $table = $this->getHelperSet()->get('table'); instead :)

Copy link
Contributor

Choose a reason for hiding this comment

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

@sgehrig I mean use $table = new Table($output);

Copy link
Member

Choose a reason for hiding this comment

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

see #14338 for the table helper fix

@fabpot
Copy link
Member

fabpot commented Apr 12, 2015

If merged, should be in 2.8.

/**
* @param string $locale
* @param string $rootPath
* @return MessageCatalogue
Copy link
Contributor

Choose a reason for hiding this comment

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

white-line before return (you can use php-cs-fixer)

@aitboudad
Copy link
Contributor

👍

@sgehrig
Copy link
Contributor Author

sgehrig commented Apr 15, 2015

@aitboudad: Anything more I need to do?

@aitboudad
Copy link
Contributor

@sgehrig only one ;) , use $table = new Table($output); instead of getHelperSet

@sgehrig
Copy link
Contributor Author

sgehrig commented Apr 15, 2015

@aitboudad Done. Thanks for your patience ;-)

@aitboudad
Copy link
Contributor

@symfony/deciders Is it ok for you?

$table->render($output);
}
$output->writeln('');
$output->writeln('<info>Legend:</info>');
Copy link
Contributor

Choose a reason for hiding this comment

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

the legend has been removed see #14473

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

use Symfony\Component\Console\Helper\Table;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Translation\Catalogue\MergeOperation;
Copy link
Member

Choose a reason for hiding this comment

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

Imho it would be better to add them in alphabetical order.

@sgehrig
Copy link
Contributor Author

sgehrig commented Apr 28, 2015

Fixed those coding style issues. They resulted from the rebase merge.

@xabbuh
Copy link
Member

xabbuh commented Apr 28, 2015

@sgehrig Thanks, can you please also revert the changes to the other if statements where you wrapped conditions?

@sgehrig
Copy link
Contributor Author

sgehrig commented Apr 28, 2015

Need to get used to the Symfony code guidelines... ;-) Unnecessary changes should have been reverted...

@xabbuh
Copy link
Member

xabbuh commented Apr 28, 2015

👍

@sgehrig I didn't want to bother you. It's just easier to track changes in the future (for example when using git blame) if we limit changes to what is really necessary. Thank you for your patience!

@sgehrig
Copy link
Contributor Author

sgehrig commented Apr 28, 2015

@xabbuh No problem... ;-)

@aitboudad
Copy link
Contributor

Thank you @sgehrig.

aitboudad added a commit that referenced this pull request Apr 29, 2015
…lation command #14237 (sgehrig)

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

Discussion
----------

[Translation] added an --all option to the debug:translation command #14237

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

- [ ] submit changes to the documentation

This PR adds an `--all` option the `debug:translation` command to enable debugging translations in all registered bundles *AND* the app directory.

Commits
-------

0e7fe79 added the --all option to the debug:translation command
@aitboudad aitboudad closed this Apr 29, 2015
@sgehrig sgehrig deleted the ticket_14237 branch May 6, 2015 06:46
@fabpot fabpot mentioned this pull request Nov 16, 2015
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