diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php index 24cc95084c..0f8ab152d9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php @@ -83,17 +83,31 @@ EOF { $locale = $input->getArgument('locale'); $domain = $input->getOption('domain'); - $bundle = $this->getContainer()->get('kernel')->getBundle($input->getArgument('bundle')); + $kernel = $this->getContainer()->get('kernel'); + $bundle = $kernel->getBundle($input->getArgument('bundle')); $loader = $this->getContainer()->get('translation.loader'); // Extract used messages $extractedCatalogue = new MessageCatalogue($locale); - $this->getContainer()->get('translation.extractor')->extract($bundle->getPath().'/Resources/views', $extractedCatalogue); + $bundlePaths = array( + $bundle->getPath().'/Resources/', + sprintf('%s/Resources/%s/', $kernel->getRootDir(), $bundle->getName()), + ); + + foreach ($bundlePaths as $path) { + $path = $path.'views'; + if (is_dir($path)) { + $this->getContainer()->get('translation.extractor')->extract($path, $extractedCatalogue); + } + } // Load defined messages $currentCatalogue = new MessageCatalogue($locale); - if (is_dir($bundle->getPath().'/Resources/translations')) { - $loader->loadMessages($bundle->getPath().'/Resources/translations', $currentCatalogue); + foreach ($bundlePaths as $path) { + $path = $path.'translations'; + if (is_dir($path)) { + $loader->loadMessages($path, $currentCatalogue); + } } // Merge defined and extracted messages to get all message ids