Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

class Import implements ImportInterface
{
protected ConfigurationInterface $configuration;
protected Connection $connection;
protected EventDispatcherInterface $dispatcher;
protected TranslatorInterface $translator;
protected LoggerInterface $logger;
protected Collection $config;
protected StrategyRepositoryInterface $strategyRepository;
Expand All @@ -41,13 +43,15 @@ public function __construct(
StrategyRepositoryInterface $strategyRepository,
LoadStrategyRepositoryInterface $loadStrategyRepository,
ConfigurationInterface $configuration,
TranslatorInterface $translator,
?LoggerInterface $logger = null
) {
$this->configuration = $configuration;
$this->connection = $connection;
$this->dispatcher = $dispatcher;
$this->strategyRepository = $strategyRepository;
$this->loadStrategyRepository = $loadStrategyRepository;
$this->translator = $translator;
$this->logger = $logger ?? new NullLogger();
$this->loaders = new ArrayCollection();
}
Expand Down Expand Up @@ -199,10 +203,10 @@ private function loadResource(ImportResource $resource): bool
}

if (($count = $this->loadData($resource, $file)) !== 0) {
$this->logger->notice('{file}: {count} lines loaded', [
'file' => $file->getBasename(),
'count' => $count, ]
);
$this->logger->notice($this->translator->trans('{file}: {count} lines loaded', [
'{file}' => $file->getBasename(),
'{count}' => $count,
]));
$loaded = true;
}
}
Expand Down