This Greasemonkey script displays a translation button below a toot if the toot contains text that is not in your native language or the other languages you set in your settings.
To use this script you need to create a DeeplL Free API authentication key.
"Once your API Free quota of 500.000 characters per month has been consumed, no more translations via the API take place.
That means, you will be able to translate again starting on the following monthly period, or upgrade to API Pro directly in your account."
See the following page to setup a free API key and look at your account settings:
If you installed the Script and then go to the WebClient of a Mastodon instance,
a dialog will open where you can enter the key.
This key will be stored in your browser localstorage.
Afterwards you can access the settings via the slideout button in the upper right corner of the browser window.