Skip to content

Commit

Permalink
bug #16757 [FrameworkBundle] [Translation] Fixed translations not wri…
Browse files Browse the repository at this point in the history
…tten 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
  • Loading branch information
fabpot committed Dec 8, 2015
2 parents b8fbe69 + 8c45107 commit 420da14
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
}

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();
Expand Down

0 comments on commit 420da14

Please sign in to comment.