[FrameworkBundle] Fixed Translation loader and update translation command.
This commit is contained in:
parent
1532b4e681
commit
2ca438deb6
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Reference in New Issue