Tetra is a text translation plugin for Terminator terminal emulator, which uses Google Translate undocumented API.
To install plugin properly, you need CMake build system (and, of course, Terminator) installed. Process is quite simple:
- Run cmake CMakeLists.txt
- After makefile was successfully generated, run make install_tetra. This command will copy tetra's scripts to Terminator's default plugin directory (i.e, ~/.config/terminator/plugins)
For translate some word, or phrase, or maybe a big part of text you should select it by mouse and rightclick to popup a standart context menu. Next, choose a menu item named Translate {your text} and wait for submenu's activation which shows you translated version of text.
By now, selection of source and target languages for translation is in development. Despite the fact there are some code snippets related to this feature, it doesn't work properly yet, so disabled. Languages can be correctly changed just by hardcoding py_translator module, currently.
There is translator directory which contains some C++/Boost related stuff wrapping the same translation API as py_translator module (i.e. Boost::Asio HTTP client and Boost::Python interface to python plugin script. It wasn't invention of the wheel, just my experiments with Boost. If for some reasons you want to use it - feel free to run make tetra_translator (need Boost installed) to compile it and link to shared library. But be careful: there are no methods to call it from plugin's script for now.