Terminal Translator is a translation CLI that uses the Google Cloud API.
See the full documentation
Installation is very simple, just run the following command in the terminal:
pip install tt-terminal-translator
The CLI consists of two commands, tt
and tt-configure
.
tt
is the main CLI command.
Usage
Basically we call the command passing the text to be translated
By default the text will be translated to en-us
tt ola mundo
We can also inform the target language for the translation
tt ola mundo --target es # spanish
There is also a parameter to translate directly into Portuguese
tt hello world -p
In addition there is a parameter to copy the output directly to the clipboard
tt -c hola mundo
For more information use the parameter --help
tt --help
tt-configure
is only for the initial configuration of the Google Cloud API credentials, as seen in the settings section.
Usage
Basically we call the command passing two arguments, first the project-id followed by the path of the credentials Json file.
tt-configure <project-id> <google-api-credentials>
For quick help use the --help
argument.
tt-configure --help