GSTranslator is a simple translator integrated with Gnome Shell. It uses Google Translate technology.
Short presentation video: youtu.be/wOMi71Vwvwg
- Gnome 3.4
- Python 2.7
- Dbus
- python-dbus (for Python 2.7)
- Copy directory
gstranslator2@thof.github.com
to~/.local/share/gnome-shell/extensions/
- As root, copy schema file
gstranslator2@thof.github.com/org.gnome.shell.extensions.gstranslator2.gschema.xml
to/usr/share/glib-2.0/schemas/
- Compile schemas (as root):
glib-compile-schemas /usr/share/glib-2.0/schemas/
- Restart shell and enable extension
- You can copy
gstranslator2_service.py
to/usr/local/bin
and make it executablechmod +x /usr/local/bin/gstranslator2_service.py
- Enable extension
- Adjust settings (preferences icon)
- Run GSTranslator2 service
gstranslator2_service.py
By default this menu appear when you press <Super>d or click on "T" button. You can switch between languages using <Control>Left/<Control>Right keys. To get standard translation use Enter key or <Shift>Enter for expanded translation.
- service may hang for 5-10 seconds on one of the first words. Somehow urllib2.urlopen freezes for several seconds, but it does not report any error or warning. After that it responses immediately on the following words. Weird...
Gnome Shell extension communicates with GSTranslator service using DBus. It sends requests for translations. There are two types of requests: translate text from clipboard, translate text from menu entry. In response service written in Python, returns label with translation.