Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Target Language (ISO Code) [deeplTargetLanguage] is empty #370

Closed
medarob opened this issue Oct 21, 2024 · 14 comments · Fixed by #372
Closed

[BUG] Target Language (ISO Code) [deeplTargetLanguage] is empty #370

medarob opened this issue Oct 21, 2024 · 14 comments · Fixed by #372
Assignees
Labels
bug Something isn't working

Comments

@medarob
Copy link

medarob commented Oct 21, 2024

Describe the bug
We have installed the extension for the first time. In the site config we noticed that the Target Language (ISO Code)[deeplTargetLanguage] field is empty in the ENGLISCH and GERMAN site configuration.
The site has just two languages: German and English

We couldn't find anything in the documentation about configuring it and as we unserstand it, the values in the dropdown should be picked up automatically?

What have we missed?

Screenshots
German [ID 0]
grafik

ENGLISCH [ID 1]
grafik

TYPO3 Setup

  • TYPO3 Version: 11.5.41
  • Server: Apache/2.4.6 () OpenSSL/1.0.2k-fips
  • Database type and version: MySQL 10.4.34-MariaDB
  • PHP version 8.2.20
  • DeepL free or paid API? Free
  • composer or classic setup? composer
@medarob medarob added the bug Something isn't working label Oct 21, 2024
@calien666
Copy link
Member

@medarob This should mean, you don't have the API key set up correct.

Please take a look at https://docs.typo3.org/p/web-vision/wv_deepltranslate/draft/en-us/Reference/ExtensionConfiguration/Index.html

@medarob
Copy link
Author

medarob commented Oct 21, 2024

Mh, the API key was added before:
grafik

The two options to translate the elements are available but don't translate any text:
grafik

@calien666
Copy link
Member

Okay, seems, that your cache is broken, if the key is valid. Please go to your server and delete the files located in var/cache/data/wvdeepltranslate, as sometimes they are created empty, which should not happen, but in some cases, we couldn't detect, happens.

@medarob
Copy link
Author

medarob commented Oct 21, 2024

I delete the two files, no change.
I installed the main-branch because there was a proxy fix included and we have a proxy, cleared all caches but still no change.

  - Upgrading typo3/class-alias-loader (v1.1.4 => v1.2.0): Extracting archive
  - Upgrading guzzlehttp/promises (2.0.3 => 2.0.4): Extracting archive
  - Downgrading deeplcom/deepl-php (v1.9.0 => v1.8.0): Extracting archive
  - Upgrading web-vision/wv_deepltranslate (4.3.1 => dev-main d82b991): Extracting archive

The package deeplcom/deepl-php was downgraded, all other packages where updated. No sure if that is correct?

The content of wv-deepl-supported-languages-source/target is just a:0:{}.

The configuration settings have changed and the field Deepl Formality is now not available anymore.
grafik

@medarob
Copy link
Author

medarob commented Oct 21, 2024

Is there a way to find out if the connection to Deepl works in general? Something like a status icon which shows if a connection to Deepl could be established or not.

@calien666
Copy link
Member

The downgrade of deeplcom/deepl-php is correct, as we currently work with the older code and have to fix for the latest deepl-php.

Formality is now gone to SiteConfiguration and no longer part of the extension settings, as you are now able to define formality per language and no longer for the complete system.

If your connection to DeepL API is correct, should be simply tested by calling the deepl:glossary:list command. If the connection doesn't work properly, you should get an error there.

@medarob
Copy link
Author

medarob commented Oct 21, 2024

The TYPO3 error log shows the following:
[ERROR] request="3c5629b5ceb99" component="WebVision.WvDeepltranslate.Client": Failed connect to api-free.deepl.com:443; No route to host (7)

So, the connection to Deepl doesn't work I would think. Maybe it has something to do with the proxy settings but not sure what I have to change here...

Just a side note:
Maybe a feature could be added with a status text that the connection to Deepl is OK/Not OK.

@h-e-l-l-o-w-o-r-l-d
Copy link

Same here. Digged deeper into it and found out that there are several problems with your implementation of getting the proxy setting:

  • You should not use GeneralUtility::isValidUrl(), as it returns NULL if there's no protocol. As proxy settings are usualy set without protocol (see TYPO3 Docs), it always returns NULL in that case.
  • You don't respect $GLOBALS['TYPO3_CONF_VARS']['HTTP']['proxy']['no']
  • You don't respect $GLOBALS['TYPO3_CONF_VARS']['HTTP']['proxy']['https']

The first point is the cause for this issue, the others should be respected, too.

See dd_deepl for a perfectly working implementation. ;-)

@calien666
Copy link
Member

We will take a look into the proxy settings and configurations, adjusting the code, fitting all requirements. Thank you for reporting.

@h-e-l-l-o-w-o-r-l-d
Copy link

Thank you!

@Mabahe
Copy link
Contributor

Mabahe commented Oct 22, 2024

Hey, had an issue related to this and have already a patch. Will push a PR in a minute.

Mabahe added a commit to Mabahe/wv_deepltranslate that referenced this issue Oct 22, 2024
Since all $GLOBALS['TYPO3_CONF_VARS']['HTTP'] options should be
respected we can simple use the built in client. Also 'proxy'
is respected in this case, so we don't need a extra setting for this.

Resolves: web-vision#370
Relates: web-vision#331
Mabahe added a commit to Mabahe/wv_deepltranslate that referenced this issue Oct 22, 2024
Since all $GLOBALS['TYPO3_CONF_VARS']['HTTP'] options should be
respected we can simple use the built in client. Also 'proxy'
is respected in this case, so we don't need a extra setting for this.

Resolves: web-vision#370
Relates: web-vision#331
@Mabahe
Copy link
Contributor

Mabahe commented Oct 22, 2024

Pushed. If anybody want to test based on the latest release here is the commit for 4.3.1:
Mabahe@86401f1

Mabahe added a commit to Mabahe/wv_deepltranslate that referenced this issue Oct 22, 2024
Since all $GLOBALS['TYPO3_CONF_VARS']['HTTP'] options should be
respected we can simple use the built in client. Also 'proxy'
is respected in this case, so we don't need a extra setting for this.

Resolves: web-vision#370
Relates: web-vision#331
Mabahe added a commit to Mabahe/wv_deepltranslate that referenced this issue Oct 22, 2024
Since all $GLOBALS['TYPO3_CONF_VARS']['HTTP'] options should be
respected we can simple use the built in client. Also 'proxy'
is respected in this case, so we don't need a extra setting for this.

Resolves: web-vision#370
Relates: web-vision#331
@Mabahe
Copy link
Contributor

Mabahe commented Oct 22, 2024

finally... :-)

@mschwemer
Copy link

We had the same issue with a client setup.

I can confirm the PR works here too.

calien666 pushed a commit that referenced this issue Nov 20, 2024
Since all $GLOBALS['TYPO3_CONF_VARS']['HTTP'] options should be
respected we can simple use the built in client. Also 'proxy'
is respected in this case, so we don't need a extra setting for this.

Resolves: #370
Relates: #331
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants