Skip to content

Commit

Permalink
Merge 2872fe1 into d18aefd
Browse files Browse the repository at this point in the history
  • Loading branch information
acrobat committed Oct 18, 2019
2 parents d18aefd + 2872fe1 commit f893439
Showing 1 changed file with 16 additions and 4 deletions.
Expand Up @@ -37,11 +37,23 @@ class ImportCommandHandler extends AbstractCommandHandler
*/
public function executeImportCommand(ImportCommand $importCommand)
{
if ($importCommand->getGlobals() || $importCommand->getDefaultBundle() === false || $importCommand->getDefaultBundle() === null) {
return $this->importGlobalTranslationFiles($importCommand);
$amount = 0;
$defaultBundleNotSet = $importCommand->getDefaultBundle() === false || $importCommand->getDefaultBundle() === null;

if ($importCommand->getGlobals()) {
$amount = $this->importGlobalTranslationFiles($importCommand);
if ($defaultBundleNotSet) {
return $amount;
}
}

return $this->importBundleTranslationFiles($importCommand);
if ($defaultBundleNotSet) {
$importCommand->setDefaultBundle('all');
}

$amount += $this->importBundleTranslationFiles($importCommand);

return $amount;
}

/**
Expand Down Expand Up @@ -126,7 +138,7 @@ private function importAllBundlesTranslationFiles(ImportCommand $importCommand)
private function importOwnBundlesTranslationFiles(ImportCommand $importCommand)
{
$imported = 0;
$srcDir = $this->kernel->getProjectDir() . '/src';
$srcDir = $this->kernel->getProjectDir().'/src';

foreach ($this->kernel->getBundles() as $name => $bundle) {
if (strpos($bundle->getPath(), $srcDir) !== false) {
Expand Down

0 comments on commit f893439

Please sign in to comment.