dmitryd / dd_deepl

3 stars 10 forks source link

add proxy-settings as parameter to deepl-api #16

Closed dirnbauer closed 8 months ago

dirnbauer commented 8 months ago

We use TYPO3 with proxy-settings $GLOBALS['TYPO3_CONF_VARS']['HTTP']['proxy']. the following simple patch works for me.

in Classes/Service/DeeplTranslationService.php add TranslatorOptions::PROXY, either the value from the globals or empty.

I hope this helps. thanks for your great work!

 if (Environment::isComposerMode()) {
            $deeplOptions = array_merge(
                [
                    TranslatorOptions::SERVER_URL => $this->configuration->getApiUrl(),
                    TranslatorOptions::TIMEOUT => 10,
                    TranslatorOptions::PROXY => $GLOBALS['TYPO3_CONF_VARS']['HTTP']['proxy'] ?? '',
                ],
                $deeplOptions
            );
dmitryd commented 8 months ago

Thank you! The release will be soon.

dirnbauer commented 8 months ago

great, thank you!