From b9f8c192faf0208e1f3d1a9486aecc2e50b54de6 Mon Sep 17 00:00:00 2001 From: Anton Fedurtsya Date: Thu, 28 Sep 2023 18:27:02 +0300 Subject: [PATCH] Use getLanguageStrings language method through MediaLibrary LanguageInterface Signed-off-by: Anton Fedurtsya --- src/Application/Controller/WysiwygLangJs.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Application/Controller/WysiwygLangJs.php b/src/Application/Controller/WysiwygLangJs.php index 8427d0d..15498b6 100755 --- a/src/Application/Controller/WysiwygLangJs.php +++ b/src/Application/Controller/WysiwygLangJs.php @@ -8,8 +8,8 @@ namespace OxidEsales\WysiwygModule\Application\Controller; use OxidEsales\Eshop\Application\Controller\FrontendController; -use OxidEsales\Eshop\Core\Language; use OxidEsales\Eshop\Core\Registry; +use OxidEsales\MediaLibrary\Transition\Core\LanguageInterface; use OxidEsales\WysiwygModule\Core\Utils; /** @@ -22,14 +22,13 @@ class WysiwygLangJs extends FrontendController */ public function init() { - /** @var \OxidEsales\WysiwygModule\Core\Language $oLang */ - $oLang = oxNew(Language::class); + $languages = $this->getService(LanguageInterface::class); header('Content-Type: application/javascript'); /** @var Utils $oUtils */ $oUtils = Registry::getUtils(); - $sJson = $oUtils->encodeJson($oLang->getLanguageStrings()); + $sJson = $oUtils->encodeJson($languages->getLanguageStringsArray()); $oUtils->showMessageAndExit(";( function(g){ g.i18n = " . $sJson . "; })(window);"); } }