benbusby / farside

A smart redirecting gateway for various frontend services
https://farside.link
MIT License
754 stars 46 forks source link

Feature request: Add LibreTranslate #21

Open Mennaruuk opened 2 years ago

Mennaruuk commented 2 years ago

Free and Open Source Machine Translation API, entirely self-hosted. Unlike other APIs, it doesn't rely on proprietary providers such as Google or Azure to perform translations. Instead, its translation engine is powered by the open source Argos Translate library.

List of instances

benbusby commented 2 years ago

LibreTranslate support isn't currently possible with Farside, since it requires a POST request for all translations, whereas Farside's redirecting behavior relies only on formatting URLs (so only GET requests).

I'll keep this issue open for now though, and I'll consider adding POST request support if there are other FOSS services that require it.

NoPlagiarism commented 1 year ago

LibreTranslate can be used with parameters to load needed translate

Code responsible for that

Parameters:

Example: ?source=ru&target=uk&q=кот

benbusby commented 1 year ago

@NoPlagiarism nice, thanks for pointing that out. I was going to look into adding it into Farside, but it looks like only one of the listed public instances (https://translate.argosopentech.com) is functional aside from the official libretranslate.com one (which asks to not use without a paid API key for production apps). I'd consider buying an API key if it wasn't more expensive than the actual hosting for Farside.

Either way, I might still add it just so that it's supported, and leave out the official paid instance for now. There also needs to be an update to change Google Translate's sl/tl/text params to source/target/q before the redirect happens.