diff --git a/Classes/Override/LocalizationController.php b/Classes/Override/LocalizationController.php index 22bdb6ba..da9ab8c3 100644 --- a/Classes/Override/LocalizationController.php +++ b/Classes/Override/LocalizationController.php @@ -28,6 +28,7 @@ use TYPO3\CMS\Core\Page\PageRenderer; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Versioning\VersionState; +use WebVision\WvDeepltranslate\Configuration; use WebVision\WvDeepltranslate\Service\DeeplService; /** @@ -49,12 +50,14 @@ class LocalizationController extends \TYPO3\CMS\Backend\Controller\Page\Localiza protected DeeplService $deeplService; protected PageRenderer $pageRenderer; + private Configuration $configuration; public function __construct() { parent::__construct(); $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class); + $this->configuration = GeneralUtility::makeInstance(Configuration::class); $this->deeplService = GeneralUtility::makeInstance(DeeplService::class); $this->pageRenderer->addInlineLanguageLabelFile('EXT:wv_deepltranslate/Resources/Private/Language/locallang.xlf'); } @@ -266,7 +269,7 @@ protected function process($params): void public function checkdeeplSettings(ServerRequestInterface $request) { $result = []; - if ($this->deeplService->apiKey != null && $this->deeplService->apiUrl != null) { + if ($this->configuration->getApiKey() != null && $this->configuration->getApiUrl() != null) { $result['status'] = 'true'; } else { $result['status'] = 'false';