Skip to content

Commit

Permalink
Use getLanguageStrings language method through MediaLibrary LanguageI…
Browse files Browse the repository at this point in the history
…nterface

Signed-off-by: Anton Fedurtsya <[email protected]>
  • Loading branch information
Sieg committed Sep 28, 2023
1 parent 3d5ec0f commit b9f8c19
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Application/Controller/WysiwygLangJs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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);");
}
}

0 comments on commit b9f8c19

Please sign in to comment.