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
This commit is contained in:
Fabien Potencier 2015-12-08 19:14:24 +01:00
commit 420da14156

View File

@ -188,9 +188,11 @@ EOF
}
}
if ($bundleTransPath) {
$writer->writeTranslations($operation->getResult(), $input->getOption('output-format'), array('path' => $bundleTransPath, 'default_locale' => $this->getContainer()->getParameter('kernel.default_locale')));
if (!$bundleTransPath) {
$bundleTransPath = end($transPaths).'translations';
}
$writer->writeTranslations($operation->getResult(), $input->getOption('output-format'), array('path' => $bundleTransPath, 'default_locale' => $this->getContainer()->getParameter('kernel.default_locale')));
}
$output->newLine();