Chrome and Edge already have a translation feature and iOS Safari is going to have automatic translations (starting from iOS 14).
It would be great to have more control on this.
Basic support: trigger the translation prompt programmatically, for example when the user clicks on a different flag or language select inside the page. This would improve the UI and would be very simple to implement.
showTranslationPrompt();
Advanced support: use Javascript to translate some specific text (or the text inside specific elements) from a language to another language.
translate('Hello!', 'en', 'it');
// or
DOMElement.translate('en', 'it');