This script provides a translate toot option for Mastodon users via GoogleTranslate. Works with Mastodon 3.2.1.
It adds a drop down menu option to any toot, so that by clicking the "translate" you can translate any toot into your language.
If "Translate toot" does not appear, try refresh the page, or edit the "match" line to the addresses of your favourite instances.
By default, the target language is English. To change this behaviour, go to settings page. At the beginning of the page, you will see a "Translation language" option. You can set your target language here.
About the code:
It's forked from firstname.lastname@example.org's original version. The original script/repo is no longer maintained, so I fixed the code to make it compatible with Mastodon 3.2.1. The translation goes through tomo's open source proxy at https://translate.uchuu.io/
. Source code of the proxy is available at https://github.com/tomouchuu/mastodon-translate.
This script should work for TamperMonkey/ViolentMonkey on Chrome, and ViolentMonkey/GreaseMonkey on Firefox.
If it doesn't work for Tampermonkey + Firefox, try ViolentMonkey or GreaseMonkey for Firefox instead.
If you have any suggestions, feel free to submit an issue at https://github.com/umonaca/mastodon-translate/issues