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

Failed to make a request to the server LanguageTool #98

Open
TrueVru opened this issue Apr 17, 2023 · 8 comments
Open

Failed to make a request to the server LanguageTool #98

TrueVru opened this issue Apr 17, 2023 · 8 comments

Comments

@TrueVru
Copy link

TrueVru commented Apr 17, 2023

Recently, problems with connecting to the LanguageTool server have started, I am users from Russia. Is it possible to solve this problem somehow?
image

@Clemens-E
Copy link
Owner

You would have to check the logs what's actually happening.

Run the spell check so you get that error, then
Go to Settings > Community Plugins > LanguageTool Integration > "Copy failed Request Logs"
Then paste it here

@TrueVru
Copy link
Author

TrueVru commented Apr 18, 2023

I copy the log file after the error, but for some reason it is not inserted anywhere.
Pasted image 20230418090821

The following error is displayed in the developer console.

Pasted image 20230418090756
It is noteworthy that if I switch to a paid account, then everything works, although I do not have it.

Pasted image 20230418090950

@gabrielcarus
Copy link

5/2/2023, 4:14:20 PM:
url used for request: https://api.languagetool.org/v2/check
Status: 400
Body: Error: You specified 'preferredVariants' but you didn't specify 'language=auto'
Settings: {"serverUrl":"https://api.languagetool.org","urlMode":"standard","glassBg":false,"shouldAutoCheck":true,"pickyMode":false,"staticLanguage":"en","englishVeriety":"en-US","germanVeriety":"de-DE","portugueseVeriety":"pt-BR","catalanVeriety":"ca-ES","username":"REDACTED","apikey":"REDACTED"}

5/2/2023, 4:14:26 PM:
url used for request: https://api.languagetool.org/v2/check
Status: 400
Body: Error: You specified 'preferredVariants' but you didn't specify 'language=auto'
Settings: {"serverUrl":"https://api.languagetool.org","urlMode":"standard","glassBg":false,"shouldAutoCheck":true,"pickyMode":false,"staticLanguage":"en","englishVeriety":"en-US","germanVeriety":"de-DE","portugueseVeriety":"pt-BR","catalanVeriety":"ca-ES","username":"REDACTED","apikey":"REDACTED"}

5/2/2023, 4:14:34 PM:
url used for request: https://api.languagetool.org/v2/check
Status: 400
Body: Error: You specified 'preferredVariants' but you didn't specify 'language=auto'
Settings: {"serverUrl":"https://api.languagetool.org","urlMode":"standard","glassBg":false,"shouldAutoCheck":true,"pickyMode":false,"staticLanguage":"en","englishVeriety":"en-US","germanVeriety":"de-DE","portugueseVeriety":"pt-BR","catalanVeriety":"ca-ES","username":"REDACTED","apikey":"REDACTED"}

@Clemens-E
Copy link
Owner

You have a static language set, you can't have preferred variants and a static language

@agentlibre
Copy link

@SecNotice
Copy link

SecNotice commented Jun 12, 2023

You have a static language set, you can't have preferred variants and a static language

You say "you can't". However, these are not my problems, it is the code you wrote that returns such errors.
Perhaps the plugin does not interact with the API correctly?
What is the correct way to interact with the API in the case of "staticLanguage"?

@Clemens-E
Copy link
Owner

It is the API that returns the error.
LanguageTool can auto-detect the language, however the user above told it to use "en", while also telling it other languages it should prefer (e.g. when it detects German, it does not know if it's de_DE or de_CH, so you tell it you want de_CH).
This can only be used when the language is set to auto-detect, which it isn't.
The only thing the Plugin could do is not allow configuring it this way, or to silently drop settings without telling the user.

@Clemens-E
Copy link
Owner

Thanks to #96 it's not possible to select "auto-detect" and set a preferred language (and vice versa)
thank you @lukeleppan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants