From 83bf0c9664fc9f167d1c418c8f3b5f9ffb1909d7 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 12 Feb 2022 20:30:04 +0100 Subject: [PATCH] fix lang loading --- Interfaces/OMS/Exporter.php | 1 - Interfaces/OMS/Importer.php | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Interfaces/OMS/Exporter.php b/Interfaces/OMS/Exporter.php index d36da43..b76ec21 100755 --- a/Interfaces/OMS/Exporter.php +++ b/Interfaces/OMS/Exporter.php @@ -46,7 +46,6 @@ final class Exporter extends ExporterAbstract public function __construct(ConnectionAbstract $local, L11nManager $l11n) { parent::__construct($local, $l11n); - $this->l11n->loadLanguageFile('Exchange', __DIR__ . '/Lang/lang.php'); } /** diff --git a/Interfaces/OMS/Importer.php b/Interfaces/OMS/Importer.php index cbeda65..fcd889f 100755 --- a/Interfaces/OMS/Importer.php +++ b/Interfaces/OMS/Importer.php @@ -49,7 +49,6 @@ final class Importer extends ImporterAbstract public function __construct(ConnectionAbstract $local, ConnectionAbstract $remote, L11nManager $l11n) { parent::__construct($local, $remote, $l11n); - $this->l11n->loadLanguageFile('Exchange', __DIR__ . '/Lang/lang.php'); } /** @@ -81,6 +80,11 @@ final class Importer extends ImporterAbstract $start = new \DateTime($request->getData('start') ?? 'now'); $end = new \DateTime($request->getData('end') ?? 'now'); + $lang = []; + $lang['Exchange'] = include __DIR__ . '/Lang/' . $request->getLanguage() . '.lang.php'; + + $this->l11n->loadLanguage($request->header->l11n->getLanguage(), 'Exchange', $lang); + if ($request->getData('db') !== null) { $this->remote = ConnectionFactory::create([ 'db' => (string) ($request->getData('db') ?? ''),