soimort / translate-shell

:speech_balloon: Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc.
https://www.soimort.org/translate-shell
The Unlicense
7k stars 392 forks source link

Feature request: -b but showing both languages #485

Closed bitcoinmeetups closed 1 year ago

bitcoinmeetups commented 1 year ago

Hi,

I'm BM, a very nice and polite guy.

As it stands, if I use trans :es -b -i inputfile then I get a brief translation of the input from inputfile.

However I would like to be able to intermix input and output languages.

Current behavior input:

how are you (english)

Current behavior output:

how are you (spanish)

Desired behavior input:

how are you (english)

Desired behavior output:

how are you (english) how are you (spanish)

I would like to have both languages intermixed sentence by sentence in the output so that it is easier to read when learning the language. Hope you understand, I would like to have a flag for this, if it's not clear, then let me know and I will update again.

soimort commented 1 year ago

The -b option shows the translation and the translation only; this behavior is expected and will not be changed.

You can achieve this by simply using the verbose mode but hiding other information you don't need:

$ trans -show-original-phonetics=0 -show-prompt-message=0 -show-languages=0 -show-original-dictionary=0 -show-dictionary=0 -show-alternatives=0 :es 'how are you' 
how are you

cómo estás

You can set these options to false in a configuration file if you want it by default.