Google Translator is a simple Plasmoid created using PyQt and PyKDE4 that lets you translate sentences using the Google Translate web service.
UPDATE
Google is shutting down their Translate API come December and they have already started to require a REFERER in the request. I would have to make quite a lot of changes to make it work just for the rest of November, so the Google Translator Plasmoid is officially discontinued.
https://code.google.com/apis/language/translate/overview.html
Features
- Simpler, more intuitive (IMHO) and smaller than the Translatiod Plasmoid (some might not see this as a feature
- Select to and/or from language(s) from the dropdown lists and the translated sentence will be updated in realtime.
- Change the sentence to be translated and click on the “Go” nutton and the translated result will be updated.
- Selected languages and text is saved between sessions.
- Selected languages can be swapped easily.
- Auto-detect language.
- Docks in the Panel or on the Desktop.
Dependencies
Because I have only tried the Plasmoid on my own computer you may be able to use earlier versions.
- python-kde4 v. 4.5.1
- python-qt4 v. 4.7.2
- python-simplejson
- plasma-scriptengine-python v. 4.4.4
Installation
Download the newest version.
plasmapkg -i ./google-translator-<version>.plasmoid
If the Plasmoid is already installed you might have to run:
plasmapkg -u ./google-translator-<version>.plasmoid
From source code
Follow the instruction to download with svn.
Change to the currency-converter-plasmoid/currency-converter directory and issue the following commands:
zip -r ../google-translator.plasmoid .
cd ..
And then continue by following the instructions on KDE UserBase.
Or add it from:
“Add Widgets”=>”Get New Widgets”=>”Download New Plasma Widgets”
Known Issues
As the Plasmoid gets its language codes from KLocale in kdelibs you will probably get the “invalid translation language pair” message more often than in the web based Google Translate and there maybe languages missing that Google Translate supports.
Changelog
-<version>



All posts
November 19, 2009 at 13:36
Can’t install(
neither from kde-look, not from your site
just plasma restarting((
all needed packages are installed
November 19, 2009 at 17:48
Do you mean Plasma is crashing and then restarting?
What version of KDE do you use? Which distribution?
November 19, 2009 at 17:49
And how do you try to install it?
June 18, 2010 at 01:18
Hi!
I get this error when running your widget:
setup_network: 0
Traceback (most recent call last):
File “/usr/share/kde4/apps/plasma_scriptengine_python/pyappletscript.py”, line 55, in init
self.pyapplet.init()
File “/home/cbourque/.kde4/share/apps/plasma/plasmoids/google-translator/contents/code/main.py”, line 62, in init
self.setup_network()
File “/home/cbourque/.kde4/share/apps/plasma/plasmoids/google-translator/contents/code/main.py”, line 285, in setup_network
notifier = Solid.Networking.notifier()
AttributeError: type object ‘Networking’ has no attribute ‘notifier’
Any idea?
Thanks
June 18, 2010 at 08:44
Which version of KDE SC are you using? I need to update this page because now I use KDE SC 4.4.4 and maybe the Python binding have improved there.
November 1, 2010 at 18:22
I’m using KDE 4.4.5, and the widget doesn’ work. I got a “Script initialization failed”…
November 1, 2010 at 19:50
Can you try to run it view plasmoidviewer from Konsole and check the output?
plasmoidviewer google-translator
November 4, 2010 at 23:19
Hi tanghus, the output of the script is different than the Zefiryn output.
Traceback (most recent call last):
File “/usr/share/apps/plasma_scriptengine_python/pyappletscript.py”, line 59, in init
self.module = __import__(self.pluginName+’.'+relpath)
File “/usr/share/apps/plasma_scriptengine_python/plasma_importer.py”, line 107, in load_module
exec code in mod.__dict__
File “/home/hector/.kde4/share/apps/plasma/plasmoids/google-translator/contents/code/main.py”, line 33, in
from GoogleTranslator import GoogleTranslator
File “/usr/share/apps/plasma_scriptengine_python/plasma_importer.py”, line 107, in load_module
exec code in mod.__dict__
File “/home/hector/.kde4/share/apps/plasma/plasmoids/google-translator/contents/code/GoogleTranslator.py”, line 33, in
import os, simplejson
ImportError: No module named simplejson
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
I’m using Gentoo 10.1.
November 5, 2010 at 00:57
Hector:
Please read on this page the section “Dependencies” which says “python-simplejson”.
You need to install the Python module simplejson. It depends on your distribution how you install it. In a debian-derivate (*ubuntu etc.) you should run:
sudo apt-get install python-simplejson
November 2, 2010 at 21:40
I have the same problem. The output from the plasmoidviewer is:
GoogleTranslatorApplet: init().
init() in BasePlasmoid
Name: Google Translator
Description: Translate short sentences using Google Translate
Version: 0.6
Category: Language
Author: Thomas Olsen
Plugin name: google-translator
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
NetworkMonitor: 1
NetworkMonitor: Connected to network notifier.
NetworkMonitor: Network is connected: False
NetworkMonitor: Current status: Unknown
GoogleTranslatorApplet: Creating main widget.
GoogleTranslator: init
missing new-style support for KIO.Job.result
GoogleTranslator: init. Done
Traceback (most recent call last):
File “/usr/share/apps/plasma_scriptengine_python/pyappletscript.py”, line 75, in init
self.pyapplet.init()
File “/home/zefiryn/.kde4/share/apps/plasma/plasmoids/google-translator/contents/code/main.py”, line 66, in init
self.setGraphicsWidget(self._widget)
File “/usr/lib/python2.6/site-packages/PyKDE4/plasmascript.py”, line 49, in __getattr__
return getattr(self.applet, key)
AttributeError: ‘Applet’ object has no attribute ‘setGraphicsWidget’
I’m using Mandriva 2010.1 with KDE 4.4.3,
python-kde4 v. 4.4.3
python-qt4 v. 4.7.3
python-simplejson-2.1.1
plasma-scriptengine-python v. 4.4.3 (in Mandriva this package is a part of kdebase4-workspace)
I suppose that the problem is python-kde4 package. There must be some change in kde 4.5
November 2, 2010 at 22:07
Yes, though I guess it’s the plasma-scriptengine-python that has to be at least 4.5. Guess it’s time to upgrade your KDE
November 2, 2010 at 22:32
The problem is Mandriva haven’t made KDE 4.5 packages yet and I’m rather reluctant to upgrading from KDE packages since there may be some differences and I have just reinstalled the system, so it is clean. If there will be no update by MDV I try updating KDE myself.
For the time being, tomorrow I’ll try updating just scriptengine to 4.5
By the way. I’ve tried 0.5.1 version and the widget couldn’t establish internet connection.
November 2, 2010 at 22:52
Hmm. Two bad that there are no newer packages.
About 0.5.1 not being able to connect it’s actually an error in Solid on some distributions where it reported network connection as ‘Unknown’ even though there was a connection. There’s a small workaround in 0.6.
November 3, 2010 at 00:05
Solid fix worked.
Those who, like me, wait for a KDE update in their distro may download this fix. I hope it wouldn’t be inappropriate if I use original package. I renamed it to google-translator-0.5.1.1 since it is small fix.
The plasmoid is here: http://wierzba.wzks.uj.edu.pl/~08_jewula/pliki/google-translator-0.5.1.1.plasmoid
January 8, 2011 at 07:10
Hello!
Not work. “Script initialization failed”
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: Нет такого файла или каталога
QFileSystemWatcher: failed to add paths: /home/mohn/.config/ibus/bus
Bus::open: Can not get ibus-daemon’s address.
IBusInputContext::createInputContext: no connection to ibus-daemon
plasmoidviewer(2560)/kdecore (services) KServiceFactory::findServiceByDesktopPath: “” not found
GoogleTranslatorApplet: init().
init() in BasePlasmoid
Name: Google Translator
Description: Translate short sentences using Google Translate
Version: 0.6
Category: Language
Author: Thomas Olsen
Plugin name: google-translator
Updating from version ’0.0.0′ to ’0.6′
google-translator icon installed
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
NetworkMonitor: 1
NetworkMonitor: Connected to network notifier.
NetworkMonitor: Network is connected: True
NetworkMonitor: Current status: Connected
GoogleTranslatorApplet: Creating main widget.
GoogleTranslator: init
GoogleTranslator: init. Done
Traceback (most recent call last):
File “/usr/share/kde4/apps/plasma_scriptengine_python/pyappletscript.py”, line 75, in init
self.pyapplet.init()
File “/home/mohn/.kde/share/apps/plasma/plasmoids/google-translator/contents/code/main.py”, line 66, in init
self.setGraphicsWidget(self._widget)
File “/usr/lib/pymodules/python2.6/PyKDE4/plasmascript.py”, line 49, in __getattr__
return getattr(self.applet, key)
AttributeError: ‘Applet’ object has no attribute ‘setGraphicsWidget’
job_done
January 8, 2011 at 11:54
Hi Mohn
What KDE SC version are you using?
Google Translator 0.6 need at least verson 4.5.x
/Thomas
January 8, 2011 at 13:40
I’m using KDE 4.4.5
it seems I have to upgrade my kubuntu 10.04
January 8, 2011 at 13:49
Yes. Sorry for the trouble. Next version will automatically check version number and give an appropriate error message.
August 24, 2011 at 15:12
I’m sometimes getting the message “Waiting for network connection” on my kubuntu netbook system, although I am not doing anything with the Google Translator. There should be no message at all, as long as I am not searching for new translations.
August 25, 2011 at 17:50
Hi Gerold
You can disable the notification by going to ‘System Settings’/'Application And System Notifications’, select ‘Google Translator Plasma Widget’ from the dropdown list, select ‘Waiting for Network’ and remove the check mark from ‘Show a message in a popup’.
The notification should only be triggered if you loose your network connection. If you are on eg. a mobile network connection this can happen and the best solution is as described above.
For now this is the default behavior as I share base classes with all the Plasma Widgets I’ve made and this behavior is in the base class.
November 5, 2011 at 15:56
Hi, I really love this – but now I’m using KDE 4.6.5 on OpenSUSE 11.4, all I get is “Unknown translation error!”. This applies both with Welsh (which is my main usage) and also more “mainstream” languages.
November 5, 2011 at 16:04
Yeah, I should have mentioned. Google is closing down their translation API so the Google Translator Plasmoid is discontinued. The Translatoid Plasmoid (can be found at http://kde-look.org) still works for now.
I will see if I can make a new Plasmoid using another translation engine, but it will take some time.
Sorry for the inconvenience.
November 5, 2011 at 20:56
Don’t apologise, not your fault! Thanks for all your work.
January 9, 2012 at 19:26
Hi,
i think is possible to use google translator without API also. If you see querys are sent by a simple url scheme and result is displayed in a div called result_box
December 22, 2011 at 18:34
Kurcze niestety Was nie rozumiem ;( ale jeśli jesteście niemcami, to bardzo nie dobrze! yyy gdzie ten granat?
December 22, 2011 at 18:48
Sorry, but I don’t understand your question, and Google Translate doesn’t make much sense of if.
The Google Translator Plasmoid has been discontinued and will no longer be updated.