-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
Conversation
$loader = $this->getContainer()->get('translation.loader'); | ||
$kernel = $this->getContainer()->get('kernel'); | ||
/** @var TranslationLoader $loader */ | ||
$loader = $this->getContainer() |
There was a problem hiding this comment.
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');
b388239
to
38cb884
Compare
} | ||
} | ||
} elseif ($input->getArgument('all')) { |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove indent
664d1ab
to
9ae342d
Compare
} | ||
$table->setHeaders($headers); | ||
/** @var \Symfony\Component\Console\Helper\Table $table */ | ||
$table = new Table($output); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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);
There was a problem hiding this comment.
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
If merged, should be in 2.8. |
/** | ||
* @param string $locale | ||
* @param string $rootPath | ||
* @return MessageCatalogue |
There was a problem hiding this comment.
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: Anything more I need to do? |
@sgehrig only one ;) , use |
@aitboudad Done. Thanks for your patience ;-) |
@symfony/deciders Is it ok for you? |
$table->render($output); | ||
} | ||
$output->writeln(''); | ||
$output->writeln('<info>Legend:</info>'); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
Fixed those coding style issues. They resulted from the rebase merge. |
@sgehrig Thanks, can you please also revert the changes to the other |
Need to get used to the Symfony code guidelines... ;-) Unnecessary changes should have been reverted... |
👍 @sgehrig I didn't want to bother you. It's just easier to track changes in the future (for example when using |
@xabbuh No problem... ;-) |
Thank you @sgehrig. |
…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
This PR adds an
--all
option thedebug:translation
command to enable debugging translations in all registered bundles AND the app directory.