soimort / translate-shell

:speech_balloon: Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc.
https://www.soimort.org/translate-shell
The Unlicense
7.01k stars 392 forks source link

New engine(?): Add support for Lingva (alternative front-end for Google Translate) #462

Open Vinfall opened 2 years ago

Vinfall commented 2 years ago

Is it possible to add support for Lingva Translate, or any alternative front-end for popular translate services in general?

Basically it will return just the same result except that the query is done on the remote server so users can retrieves the translation without directly accessing the respective translate service.

In Lingva's case, it offers a RESTful API and a GraphQL one which allow specify source/target language and have support for audio. You can check the details in Public APIs section of the project README.

For me, this issue serves as a general inquiry about your attitude towards these services as historically speaking, such projects commonly get abandoned after a while and their APIs are subject to change from time to time. Please feel free to add a wontfix lable if that's your response regarding this and thank you for your dedication to the project!

Edit: fix a typo.

soimort commented 2 years ago

Having RESTful and GraphQL APIs would be cool. But I do have several concerns:

  1. If I understand correctly, Lingva serves like a middleware and does not provide anything extra (other than the more accessible API formats). If trans can already parse the API from Google's server, there is no need for employing an agent.
  2. There is no guarantee that those Lingva instances will be maintained for the long term (and there is probably also a risk of violation of Google's ToS). Meanwhile I'll bet https://translate.google.com/ will always be there as long as Google doesn't shut it down.

So I guess since translate-shell is an alternative (command-line) front-end itself, it might not be super interesting to make it a front-end of another alternative front-end...

Vinfall commented 2 years ago

Yeah, I share the same concerns with you. The only benefit would be just not directly accessing Google's service (by requesting the alternative front-end server) as few people have no access to it due to poisoned DNS, corporate firewall etc, while at the same time, maintaining support for these middlewares may cost unnecessary effort.

I second the alternative front-end narrative and would like to point out that the main difference between translate-shell and Lingva is whether redirecting the request to Google's server. But still, the benefit is limited and the availability of these services is subject to change.

Thank you for sharing your thoughts on this and I'll leave it for you to decide whether to close the issue.