Whole sentence translate using goldendict
Goldendict is a feature-rich dictionary lookup software, and also highly customizable, here I show how to configure it to perform whole sentence translate functionality with a command-line tool named translate-shell.
Translate Shell (formerly Google Translate CLI) is a command-line translator powered by Google Translate (default), Bing Translator, Yandex.Translate, and Apertium. It gives you easy access to one of these translation engines in your terminal:
trans -no-ansi "学而不思则罔，思而不学则殆"
To use it with goldendict, external program settings is the right place to go. By adding and enabling translate-shell executable into the external program list, the command I use is
trans :zh-CH -no-ansi %GDWORD%, the option
-no-ansi is for disabling ANSI escape code in the popup window, and then configure the hotkey for clipboard translation, you are good to go. Just simple like that.
When you want to translate a sentence or paragraph, you need highlight the sentences you want to translate first, and then hit the hotkey. A popup window will show the translation results.