Skip to content

Commit

Permalink
Changed output for translation:debug command
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Dewez authored and fabpot committed Apr 27, 2015
1 parent 09cde7c commit 6970469
Showing 1 changed file with 4 additions and 10 deletions.
Expand Up @@ -168,7 +168,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

// Display header line
$headers = array('State(s)', 'Domain', 'Id', sprintf('Message Preview (%s)', $locale));
$headers = array('State', 'Domain', 'Id', sprintf('Message Preview (%s)', $locale));
foreach ($fallbackCatalogues as $fallbackCatalogue) {
$headers[] = sprintf('Fallback Message Preview (%s)', $fallbackCatalogue->getLocale());
}
Expand Down Expand Up @@ -215,26 +215,20 @@ protected function execute(InputInterface $input, OutputInterface $output)
} else {
$table->render($output);
}

$output->writeln('');
$output->writeln('<info>Legend:</info>');
$output->writeln(sprintf(' %s Missing message', $this->formatState(self::MESSAGE_MISSING)));
$output->writeln(sprintf(' %s Unused message', $this->formatState(self::MESSAGE_UNUSED)));
$output->writeln(sprintf(' %s Same as the fallback message', $this->formatState(self::MESSAGE_EQUALS_FALLBACK)));
}

private function formatState($state)
{
if (self::MESSAGE_MISSING === $state) {
return '<fg=red>x</>';
return '<error>missing</error>';
}

if (self::MESSAGE_UNUSED === $state) {
return '<fg=yellow>o</>';
return '<comment>unused</comment>';
}

if (self::MESSAGE_EQUALS_FALLBACK === $state) {
return '<fg=green>=</>';
return '<info>fallback</info>';
}

return $state;
Expand Down

0 comments on commit 6970469

Please sign in to comment.