Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 420da14

Browse files
committed
bug #16757 [FrameworkBundle] [Translation] Fixed translations not written when no translations directory in update command (jeremyFreeAgent)
This PR was merged into the 2.7 branch. Discussion ---------- [FrameworkBundle] [Translation] Fixed translations not written when no translations directory in update command | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Currently when you run the TranslationUpdateCommand and want to write the translation in the domain file without a `translations` directory the output is `[OK] Success` but the file is not created. This PR fix the creation of the directory. Commits ------- 8c45107 [FrameworkBundle] [Translation] Fixed translations not written when no translations directory in update command
2 parents b8fbe69 + 8c45107 commit 420da14

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
188188
}
189189
}
190190

191-
if ($bundleTransPath) {
192-
$writer->writeTranslations($operation->getResult(), $input->getOption('output-format'), array('path' => $bundleTransPath, 'default_locale' => $this->getContainer()->getParameter('kernel.default_locale')));
191+
if (!$bundleTransPath) {
192+
$bundleTransPath = end($transPaths).'translations';
193193
}
194+
195+
$writer->writeTranslations($operation->getResult(), $input->getOption('output-format'), array('path' => $bundleTransPath, 'default_locale' => $this->getContainer()->getParameter('kernel.default_locale')));
194196
}
195197

196198
$output->newLine();

0 commit comments

Comments
 (0)