Skip to content

Commit 1a777a9

Browse files
committed
[TranslationDebug] workaround for getFallbackLocales.
1 parent 9a2d2c4 commit 1a777a9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Command/TranslationDebugCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
use Symfony\Component\Console\Input\InputOption;
2020
use Symfony\Component\Translation\MessageCatalogue;
2121
use Symfony\Component\Translation\Translator;
22+
use Symfony\Component\Translation\DataCollectorTranslator;
23+
use Symfony\Component\Translation\LoggingTranslator;
2224

2325
/**
2426
* Helps finding unused or missing translation messages in a given locale
@@ -157,7 +159,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
157159
// Load the fallback catalogues
158160
$fallbackCatalogues = array();
159161
$translator = $this->getContainer()->get('translator');
160-
if ($translator instanceof Translator) {
162+
if ($translator instanceof Translator || $translator instanceof DataCollectorTranslator || $translator instanceof LoggingTranslator) {
161163
foreach ($translator->getFallbackLocales() as $fallbackLocale) {
162164
if ($fallbackLocale === $locale) {
163165
continue;

0 commit comments

Comments
 (0)