Skip to content

Commit

Permalink
Merge pull request #2212 from Numkil/bug/importerWrongLocales
Browse files Browse the repository at this point in the history
[TranslatorBundle] importer requires wrong locales
  • Loading branch information
Kristof Jochmans committed Jan 14, 2019
2 parents a63100b + bb186da commit e86e6dd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Expand Up @@ -38,7 +38,7 @@ public function __construct(Importer $importer, TranslatorInterface $translator,
parent::__construct();
$this->importer = $importer;
$this->translator = $translator;
$this->locales = explode('|', $locales);
$this->locales = $locales;
}

/**
Expand Down
Expand Up @@ -216,7 +216,7 @@ public function uploadFileAction(Request $request)
if (Request::METHOD_POST === $request->getMethod()) {
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$locales = explode('|', $this->container->getParameter('requiredlocales'));
$locales = $this->getParameter('kuma_translator.managed_locales');
$data = $form->getData();
$file = $data['file'];
$force = $data['force'];
Expand Down
Expand Up @@ -27,7 +27,7 @@ services:
arguments:
- '@kunstmaan_translator.service.importer.importer'
- '@kunstmaan_translator.service.translator.translator'
- '%requiredlocales%'
- '%kuma_translator.managed_locales%'
tags:
- { name: console.command }

Expand Up @@ -74,8 +74,8 @@ public function importFromSpreadsheet(string $file, array $locales, $force = fal
}

$headers = ['domain', 'keyword'];
$locales = array_map('strtolower', $locales);
$requiredHeaders = array_merge($headers, $locales);
$requiredHeaders = array_map('strtolower', $requiredHeaders);

try {
$reader = ReaderFactory::create($format);
Expand Down

0 comments on commit e86e6dd

Please sign in to comment.