soimort / translate-shell

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

Add swap command to REPL #439

Closed Levy9Collision closed 2 years ago

Levy9Collision commented 2 years ago

Description

This PR adds :swap command to interactive mode. Command swaps source language and target language.
Example:

└> $ trans en:fr -I
Translate Shell
(:q to quit)
English> :swap
Français> :swap
English> 

Motivation

In the case of working with a pair of languages, there may often be a need to swap source and target languages. As far as I understand, these is no other way to work in shell mode with both, for example, en:fr and fr:en at the same time, but to open two tabs in terminal each for en:fr and fr:en. I suppose that :swap command can be useful for the described case.

soimort commented 2 years ago

Cool. Thanks for the PR! :+1: