Setting up and configuring the 'translate highlighted text' script
To be able to use the script, firstly install libnotify-bin (so the script can send desktop notifications), wget (to retrieve the translation from Google) and xsel (which is used to get the currently highlighted text). In Ubuntu, Linux Mint, etc. install them using the following command:
sudo apt-get install libnotify-bin wget xsel
Next, copy the script code below:
#!/usr/bin/env bash
notify-send --icon=info "$(xsel -o)" "$(wget -U "Mozilla/5.0" -qO - "http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&**tl=en**&dt=t&q=$(xsel -o | sed "s/[\"'<>]//g")" | sed "s/,,,0]],,.*//g" | awk -F'"' '{print $2, $6}')"
and paste it in a new file - let's call it notitrans
(well, you can call it whatever you want, but that's how I'll refer to it from now on).
In the script above, replace tl=en
with the language into which you want the text to be translated, for instance tl=ru
for Russian, tl=fr
for French and so on.
After you're done, save the file in your home directory and make it executable using the following command:
chmod +x ~/notitrans
Place the script in your $PATH - for instance, to copy the script to /usr/local/bin/, use the following command:
sudo mv ~/notitrans /usr/local/bin/
To be able to use the script, you can assign it a custom keyboard shortcut. Doing this depends on your desktop environment.
On GNOME (and Unity), you can do this by going to System Settings > Keyboard > Shortcuts > Custom Shortcuts, where you'll need to click "+" to add a new keyboard shortcut. Here, enter any name you want for the new custom shortcut and "notitrans" as the command:

And finally, assign a keyboard shortcut to the newly added command by clicking on it and then holding down the keys you want to assign to it. Make sure the keyboard shortcut is not already in use!
Optional: variations of the 'translate highlighted text' script

Display the translation with Zenity (which allows the text to be copied) instead of using desktop notifications:
#!/usr/bin/env bash
text="$(xsel -o)"
translate="$(wget -U "Mozilla/5.0" -qO - "http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&**tl=en**&dt=t&q=$(echo $text | sed "s/[\"'<>]//g")" | sed "s/,,,0]],,.*//g" | awk -F'"' '{print $2, $6}')"
echo -e "Original text:" "$text"'\n' > /tmp/notitrans
echo "Translation:" "$translate" >> /tmp/notitrans
zenity --text-info --title="Translation" --filename=/tmp/notitrans
For this to work, make sure Zenity is installed on your system. On Ubuntu, install it using the following command:
sudo apt-get install zenity
Display the translation in a desktop notification AND automatically copy the translation to the clipboard:
#!/usr/bin/env bash
text="$(xsel -o)"
translate="$(wget -U "Mozilla/5.0" -qO - "http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&**tl=en**&dt=t&q=$(echo $text | sed "s/[\"'<>]//g")" | sed "s/,,,0]],,.*//g" | awk -F'"' '{print $2, $6}')"
echo "$translate" | xclip -selection clipboard
notify-send --icon=info "$text" "$translate"
For this to work, make sure xclip is installed on your system. On Ubuntu, install it using the following command:
sudo apt-get install xclip