This translator uses the google translate api
.
Do not open your browser for translation anymore. We do not like touching the mouse or annoying you.
If you want to use the latest version, use the second method.
pip install terminal-translator
or
pip install git+https://github.com/jybaek/translate-in-terminal.git
if you want to build it by yourself. It's required to install wheel
.
git clone https://github.com/jybaek/translate-in-terminal.git
cd translate-in-terminal
# pip install wheel
python setup.py bdist_wheel
pip install dist/translatebot-1.0.0-py3-none-any.whl -I # slush or back-slush
if you build and execute in docker
$ docker build -t terminal_translator .
$ docker run terminal_translator 'Hi'
안녕하세요
You can type the message you want to translate behind. Analyzes the input language and automatically sets the language to be translated. More convenient is the fact that you can see the translated results directly on the screen and even save it to the clipboard! Unfortunately, this is only compatible with English and Korean.
Now, I look forward to the new world opening in your troubles.
The text can be more than one. It does not have to be wrapped by quotation marks. However, if the sentence contains a newline, you will need to add a pair of marks.
$ translate "Hello World"
안녕 세계
# or
$ translate Hello World
안녕 세계
# or
$ translate "Hello
> world"
안녕 세상
The data in clipboard must be a text format.
$ translate -c
# or
$ translate --clipboard
The result translated text will be copied to clipboard.
$ translate "Hi"
안녕
$ translate -d "Hi"
$
$ translate --help
usage: translate.py [-h] [-c] [-d] [data [data ...]]
Terminal translator
positional arguments:
data The text to query.
optional arguments:
-h, --help show this help message and exit
-c, --clipboard Using clipboard data.
-d, --dumb No showing output data.