-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Add user content translations with configurable backends #19218
Conversation
314bef4
to
b869503
Compare
b869503
to
477e723
Compare
477e723
to
a17d52d
Compare
a17d52d
to
4a03e95
Compare
This is excellent. seems to be based on https://github.com/browsermt/mts? |
some gotchas from akkoma's implementation that might be helpful here not all target languages are locale codes - whilst so, you might want to provide users with a setting to select preferred target language, this covers the above, and also since deepl only works on a relatively small subset of languages - a much smaller subset than those supported by mastodon's locale set, and these users will never be able to translate which isn't great |
What about advertising this capability to clients in |
I would like to disable this feature on the instance I'm rocking, but I cannot seem to find where to hide the button asking for translation. Is it available or is it not yet implemented? When no API key for a translation service is given, the translate button should not be displayed (as it will fail/error every time). |
This is also my motivation for wanting capability detection in the api |
There is another open-source software for self-hosting translation services called EasyNMT which supports many languages and uses more state-of-the-art techniques than LibreTranslate. https://github.com/UKPLab/EasyNMT Would it be possible also to support this backend? Unfortunately, I don't know Ruby so far, but Iooked at the code for the existing backends and it looks straightforward, so I will probably develop one for EasyNMT as soon as I find time. |
I've enabled the LibreTranslate version on my instance. A lot of foreign language posts either don't have a language set or are set as English, and so Translate isn't available. Is it possible to add a "Force Translate" to the "..." option? |
@Vollans Can you raise a feature request? |
Did anyone think about allowing manual translations? (That is what I assumed “user translation” was when I read the feature, and to my mind would be very helpful for people writing / posting, as they may want multilingual content, but prefer to have accurate human translations). |
May I refer you to |
But I came here for something else: What's the best way to ask for support of translateLocally? Should I raise a feature request? |
Server owners can configure a translation backend that enables users to translate public posts. Results are cached, so requests for translating the same string into the same language, even across different posts, does not hit the backend more than once.
Supported backends
DEEPL_API_KEY
andDEEPL_PLAN
)LIBRE_TRANSLATE_ENDPOINT
andLIBRE_TRANSLATE_API_KEY
)Screenshots
REST API
POST /api/v1/statuses/:id/translate
(supports globallang
param, otherwise defaults to user's locale), returnscontent
anddetected_source_language
. May return HTTP 404 if no backend is configured, or HTTP 503 if the backend fails to translate.This project was funded through the NGI0 Discovery Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 825322.