diff --git a/Classes/Service/DeeplService.php b/Classes/Service/DeeplService.php index 4afa7882..02eab2ef 100644 --- a/Classes/Service/DeeplService.php +++ b/Classes/Service/DeeplService.php @@ -55,8 +55,12 @@ public function __construct( $objectManager = GeneralUtility::makeInstance(ObjectManager::class); $this->deeplSettingsRepository = $objectManager->get(SettingsRepository::class); - $this->loadSupportedLanguages(); - $this->apiSupportedLanguages['target'] = $this->deeplSettingsRepository->getSupportedLanguages($this->apiSupportedLanguages['target']); + $config = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['wv_deepltranslate']; + + if ($config['apiKey'] && $config['apiUrl']) { + $this->loadSupportedLanguages(); + $this->apiSupportedLanguages['target'] = $this->deeplSettingsRepository->getSupportedLanguages($this->apiSupportedLanguages['target']); + } } /**