[FrameworkBundle] Fixed Translation loader and update translation command.

This commit is contained in:
Saro0h 2014-12-20 14:54:47 +01:00
parent 1532b4e681
commit 2ca438deb6
3 changed files with 15 additions and 0 deletions

View File

@ -116,6 +116,13 @@ EOF
? new DiffOperation($currentCatalogue, $extractedCatalogue)
: new MergeOperation($currentCatalogue, $extractedCatalogue);
// Exit if no messages found.
if (!count($operation->getDomains())) {
$output->writeln("\n<comment>No translation found.</comment>");
return;
}
// show compiled list of messages
if ($input->getOption('dump-messages') === true) {
foreach ($operation->getDomains() as $domain) {

View File

@ -47,6 +47,10 @@ class TranslationLoader
*/
public function loadMessages($directory, MessageCatalogue $catalogue)
{
if (!is_dir($directory)) {
return;
}
foreach ($this->loaders as $format => $loader) {
// load any existing translation files
$finder = new Finder();

View File

@ -67,6 +67,10 @@ class TranslationWriter
// get the right dumper
$dumper = $this->dumpers[$format];
if (isset($options['path']) && !is_dir($options['path'])) {
mkdir($options['path'], 0777, true);
}
// save
$dumper->dump($catalogue, $options);
}