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

Enhance the translate feature #43

Closed
winstonma opened this issue Sep 10, 2021 · 4 comments
Closed

Enhance the translate feature #43

winstonma opened this issue Sep 10, 2021 · 4 comments

Comments

@winstonma
Copy link

winstonma commented Sep 10, 2021

Love the einkbro on my Onyx Boox Nova

To me, the current translated page is not user friendly. I am not sure if my proposed method would improve the user-friendliness of the result. Please use the desktop browser to test the procedure first.

Let me explain my idea using an example https://stratechery.com/2021/regulators-and-reality/ as an example.

  1. Go to the translated URL: https://translate.google.com/translate?hl=en&sl=en&tl=en&u=https://stratechery.com/2021/regulators-and-reality/
  2. Open browser's developer console, and then a link will be returned while executing the following command:
  document.getElementById("contentframe").children[0].src
  1. Open the browser with the above link obtained in step 2

I think this way the translated page looks much better. But of coz on step 1 you need to set the correct sl and tl parameters. I am not sure what is the best way to provide the sl and tl parameters for the user to select. But the result seems better.

@winstonma
Copy link
Author

winstonma commented Sep 10, 2021

It seems to me that the above steps are overrated. Just checked the link and it seems to me that there is a pattern.

https://stratechery-com.translate.goog/2021/regulators-and-reality/?_x_tr_sl=en&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=ajax,elem

It seems to me that there is a general pattern

  1. For the domain name, just replace . with -, then add .translate.goog
  2. At the end, add ?_x_tr_sl=en&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=ajax,elem, the parameter _x_tr_sl is the source language and _x_tr_tl is the translated language

@plateaukao
Copy link
Owner

plateaukao commented Sep 11, 2021

@winstonma Thanks for the suggestion. Yes, it can get better results from the url you provided. I will modify the feature to adopt this way so that it can be more elegant.

Also, I added a button on vertical control bars, so that target language can be changed by user, and long press close button to hide all translation controls. :)

@winstonma
Copy link
Author

@plateaukao really look forward to the new feature 😀

@winstonma
Copy link
Author

The feature is implemented in v8.15.0 onwards. You could select different translate services by holding the translate button.

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

2 participants