I found this utility, pytranslate, which translates a variety of languages into each other using Google's translation API. It works exactly as described.
However I've gotten sick of selecting a word I do not understand, then middle-clicking it into the command. The command format is as such:
pytranslate WORD
Is there a program/script that has the ability to detect when I select a word, or a series of words with my mouse, and then executes the above command with the selected text in the place of WORD in a terminal window?
Example:
Selected text:
Bonjour mondiale...
Resultant command/result:
pytranslate Bonjour mondiale
Detected source language: fr
Hello World