soerenuhrbach / vscode-deepl

DeepL for Visual Studio Code
MIT License
33 stars 7 forks source link

Translation does not seem to work any more #45

Closed grandeljay closed 3 months ago

grandeljay commented 5 months ago

When attempting to translate text (i. e. from German to Spanish), I receive the success message but the text remains untranslated.

image

My User settings.json:

{
    "deepl.apiKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "deepl.defaultSourceLanguage": "DE",
    "deepl.defaultTargetLanguage": "EN-GB",
    "deepl.formality": "more",
    "deepl.splitSentences": "1",
    "deepl.tagHandling": "html",
    "deepl.translationMode": "Replace",
    "deepl.usePro": true,
}

I am using a DeepL Pro API key.

Any idea why?

grandeljay commented 5 months ago

I've switched to version 1.0.7 now, it's the last working version for me.

soerenuhrbach commented 5 months ago

Hi @grandeljay,

I just released a newer version (1.0.12), which includes a few bug fixes. Please check this out. If the error occurs again, check the Extension-Output and provide it in this issue.

image
grandeljay commented 4 months ago

Thanks for the update! I didn't get around to testing earlier but now I got this: image

The error appears immediately, when I attempt to translate and I can't see anything in my output console: image

I checked my settings and can't find a field for the API key any more using the UI. In my User/settings.json I found it but it's greyed out, as if it's no longer used: image

I've just updated my original comment https://github.com/soerenuhrbach/vscode-deepl/issues/45#issue-2110006832 to match what you see on the screenshot here.

soerenuhrbach commented 4 months ago

@grandeljay It's correct, that the api key is greyed out, because the api key is now stored in vscode's secret store.

The api keys should have been migrated automatically.. I don't know why it didn't worked in your case.

Please try to set your api key again using the command "DeepL: Configure extension".

grandeljay commented 4 months ago

That seemed to help, thanks! There's more though...

When I select Translate From... To... I have the following selection: image This already looks unusual to me because en-GB and en-US are usually only available as target languages, not as source languages.

I then get this response, which again seems unusual to me, since my target language (German) does support formality (right?) image

So I remove

{
  "deepl.formality": "more",
}

from my settings and then this warning appears: image Which also seems odd, since my source language was en-GB and my target language was de, not vice versa (as seen on this warning)

It all feels upside-down to me. Do you have any more ideas what I could try? Do you think uninstalling the extensions and reinstalling it, would help?

Thanks for all the help so far!

soerenuhrbach commented 4 months ago

@grandeljay If you try to translate "Hello World" with the source language "de" to "en-us" or "en-gb", then deepl returns the same texts as before. Because the original text was not German, but already English.

To make these cases visible, the extensions shows these warnings to give you the chance to resolve the issue (in case you have the from source language from previous translations).

It should work if you have the correct source language configured.


I didn't knew, that a exception is raised, if the formality is not available for the source language - I'll improve the behaviour and implement a fallback without the configured formality in case it didn't worked in first instance.

soerenuhrbach commented 4 months ago

Oh, you'r right. The prompt order has been changed with the last changes :/

The first prompt is now for the target language and the second prompt for the source language. I think it was different before, because now the order does not match with the command name "Translate from ... to ...". The correct command name should now be "Translate to ... from ...".

I'll think about how I solve that! For now please try to select the target language first.

grandeljay commented 4 months ago

The prompt order has been changed with the last changes :/ The first prompt is now for the target language and the second prompt for the source language.

Ah, good to know, thanks!

For now please try to select the target language first.

Okey dokey

soerenuhrbach commented 4 months ago

@grandeljay Does it work now?

grandeljay commented 4 months ago

Oh right, sorry. Forgot to test. It seems to work now! I guess I was simply confused by the different order of language selection.

Thank you for your help!