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

Feature request + Bug: DeepL & Google Translate free alternative / Fanyi Youdao validation issues #35

Closed
jiangaq opened this issue Jan 6, 2023 · 12 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@jiangaq
Copy link

jiangaq commented Jan 6, 2023

Thank you.

@Fevol Fevol self-assigned this Jan 6, 2023
@Fevol Fevol added the enhancement New feature or request label Jan 6, 2023
@Fevol
Copy link
Owner

Fevol commented Jan 6, 2023

Thank you for the feature request!

Officially speaking, there is no fully free choice for either DeepL or Google Translate, unless you've signed up for their API.

The plugin does include LingvaTranslate, which is a freely accessible Google Translate scraper (i.e. does not require sign-up), it should work out of the box -- though you may have to switch hosts to get the one that works best for you (or host the service yourself using Docker/Vercel).

image

As for DeepL, I can't immediately find any scrapers that work reliably and could also be added to the plugin easily. If the LingvaTranslate service doesn't work for you, I'm afraid the only other option would be to embed the websites as iframes, though I haven't tried that method myself.

@jiangaq
Copy link
Author

jiangaq commented Jan 6, 2023

Thank you for your explain.

However, I have youdao api, but it doesn't work, showing "Translation service is not validated".

When testing in setting, it shows "Validation failed: undefined".

Could you please check?

@Fevol
Copy link
Owner

Fevol commented Jan 6, 2023

Many thanks for pointing that out, it seems that the error code was not being shown properly. Something else does seem to be wrong with the validation request.

If you don't mind, could you download the below zip, and unpack it in .obsidian/plugins/translate? It contains an updated script that fixes the error code issue.

Then validate the service again and see what error code it gives, that would be immensely helpful for fixing the issue with Youdao!
https://github.com/Fevol/obsidian-translate/files/10358832/translate.zip
(above zip is compilation of this commit: https://github.com/Fevol/obsidian-translate/tree/d4e98752885a56e1fa5f5be44ce09aab8ab1a292)

@jiangaq
Copy link
Author

jiangaq commented Jan 6, 2023

Tried, it shows "Validation failed: 202" now, what does that mean?

@Fevol
Copy link
Owner

Fevol commented Jan 6, 2023

According to Youdao's API docs, it looks like the signature verification is failing due to an encoding problem. I'm not sure why that is happening, but I'll try to fix the issue ASAP.

@Fevol
Copy link
Owner

Fevol commented Jan 6, 2023

Looks like I made a few tiny mistakes with the signature procedure, could you check if it works now?

New attempt:
https://github.com/Fevol/obsidian-translate/files/10359308/translate.zip

@jiangaq
Copy link
Author

jiangaq commented Jan 6, 2023

Now returned ""Validation failed:0"

@Fevol
Copy link
Owner

Fevol commented Jan 6, 2023

Alright, after double-checking, status code "0" should mean that the request was correctly sent and retrieved, or in other words: all functions work properly.

Had to fix one last issue, but with this, you should be able to validate the service and translate text now.

Fixed version: https://github.com/Fevol/obsidian-translate/files/10359449/translate.zip

I'm really grateful for all your help with debugging this issue!

@Fevol
Copy link
Owner

Fevol commented Jan 6, 2023

Sorry, I've uploaded the wrong version, this is the actual fix:
https://github.com/Fevol/obsidian-translate/files/10359484/translate.zip

@jiangaq
Copy link
Author

jiangaq commented Jan 6, 2023

It works now, thank you so much!

@Fevol
Copy link
Owner

Fevol commented Jan 6, 2023

Incredibly glad to hear that! If you find any issues related to Youdao (or anything else), do let me know.
I'll try pushing an official fix later today, which will hopefully also improve the error messaging.

Again, thank you for helping me debug this!

@Fevol Fevol changed the title Could you add Deepl and Google translate free service choice (no need api)? Feature request: DeepL & Google Translate free service alternative Jan 6, 2023
@Fevol Fevol changed the title Feature request: DeepL & Google Translate free service alternative Feature request: DeepL & Google Translate free alternative Jan 6, 2023
@Fevol Fevol changed the title Feature request: DeepL & Google Translate free alternative Feature request + Bug: DeepL & Google Translate free alternative / Fanyi Youdao validation issues Jan 6, 2023
@Fevol Fevol added the bug Something isn't working label Jan 6, 2023
@Fevol
Copy link
Owner

Fevol commented Jan 6, 2023

I'm going to mark this as closed for now.

You can absolutely re-open this issue in case you find another bug with Fanyi Youdao!

If you (or anybody else) would like to suggest a DeepL scraper alternative for the plugin, please open up a new feature request issue.

@Fevol Fevol closed this as completed Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants