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:

1
2
3
4
5
6
7
8
9
10
11
trans -no-ansi "学而不思则罔,思而不学则殆"
学而不思则罔,思而不学则殆

(Xué ér bù sī zé wǎng, sī ér bù xué zé dài)
If you don’t think, then you don’t think about it.

学而不思则罔,思而不学则殆
[ 简体中文 -> English ]
学而不思则罔,思而不学则殆
If you don’t think, then you don’t think about it.
Learning without thought is labor lost, thought without learning is perilous.

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.