Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,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 @@ -208,26 +208,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