obsidian-languagetool-plugin
obsidian-languagetool-plugin copied to clipboard
Failed to make a request to the server LanguageTool
Recently, problems with connecting to the LanguageTool server have started, I am users from Russia. Is it possible to solve this problem somehow?
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
I copy the log file after the error, but for some reason it is not inserted anywhere.
The following error is displayed in the developer console.
It is noteworthy that if I switch to a paid account, then everything works, although I do not have it.
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"}
You have a static language set, you can't have preferred variants and a static language
It cannot connect either...
31/05/2023, 21:23:57: url used for request: https://api.languagetoolplus.com/v2/v2/check Status: 404 Body: Error: Unsupported action: 'v2/check'. Please see https://languagetool.org/http-api/swagger-ui/#/default Settings: {"serverUrl":"https://api.languagetoolplus.com/v2","urlMode":"premium","glassBg":true,"shouldAutoCheck":true,"pickyMode":true,"apikey":"REDACTED","username":"REDACTED","staticLanguage":"fr","englishVeriety":"en-GB","germanVeriety":"de-CH"}
31/05/2023, 21:26:36: url used for request: https://api.languagetool.org/v2/check Status: 400 Body: Error: Credentials provided, but server isn't configured to support this. Settings: {"serverUrl":"https://api.languagetool.org","urlMode":"standard","glassBg":true,"shouldAutoCheck":true,"pickyMode":true,"apikey":"REDACTED","username":"REDACTED","staticLanguage":"fr"}
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"?
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.
Thanks to #96 it's not possible to select "auto-detect" and set a preferred language (and vice versa) thank you @lukeleppan