Skip to content

Commit c5dda38

Browse files
committed
feature #13872 [FrameworkBundle] Added domain column when debugging translations (hiddewie)
This PR was merged into the 2.7 branch. Discussion ---------- [FrameworkBundle] Added domain column when debugging translations | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Will create if approved. This is my first PR. If I do anything wrong, please let me know and I'll try to fix it. ## Possible TODO: ``` [ ] Update relevant documentation ``` ## Explanation for the PR: While editing a web application, I was changing a LOT of translation files. The debug:translation command helps a lot, but it is hard to find out in which domain the missing/unused translations are located. By adding an extra column with the name of the domain, I get more information about the translations in the table. ## New output: ``` +----------+------------+---------------------+----------------------+ | State(s) | Domain | Id | Message Preview (nl) | +----------+------------+---------------------+----------------------+ | x | user_admin | user.iban.incorrect | user.iban.incorrect | +----------+------------+---------------------+----------------------+ Legend: x Missing message o Unused message = Same as the fallback message ``` Commits ------- 25ef76f [FrameworkBundle] Added domain column when debugging translations
2 parents 610810e + 7f116e8 commit c5dda38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Command/TranslationDebugCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
139139
$table = new Table($output);
140140

141141
// Display header line
142-
$headers = array('State(s)', 'Id', sprintf('Message Preview (%s)', $locale));
142+
$headers = array('State(s)', 'Domain', 'Id', sprintf('Message Preview (%s)', $locale));
143143
foreach ($fallbackCatalogues as $fallbackCatalogue) {
144144
$headers[] = sprintf('Fallback Message Preview (%s)', $fallbackCatalogue->getLocale());
145145
}
@@ -172,7 +172,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
172172
}
173173
}
174174

175-
$row = array($this->formatStates($states), $this->formatId($messageId), $this->sanitizeString($value));
175+
$row = array($this->formatStates($states), $domain, $this->formatId($messageId), $this->sanitizeString($value));
176176
foreach ($fallbackCatalogues as $fallbackCatalogue) {
177177
$row[] = $this->sanitizeString($fallbackCatalogue->get($messageId, $domain));
178178
}

0 commit comments

Comments
 (0)