-
 KDE-Apps.org Applications for the KDE-Desktop 
 GTK-Apps.org Applications using the GTK Toolkit 
 GnomeFiles.org Applications for GNOME 
 MeeGo-Central.org Applications for MeeGo 
 CLI-Apps.org Command Line Applications 
 Qt-Apps.org Free Qt Applications 
 Qt-Prop.org Proprietary Qt Applications 
 Maemo-Apps.org Applications for the Maemo Plattform 
 Java-Apps.org Free Java Applications 
 eyeOS-Apps.org Free eyeOS Applications 
 Wine-Apps.org Wine Applications 
 Server-Apps.org Server Applications 
 apps.ownCloud.com ownCloud Applications 
--
-
 KDE-Look.org Artwork for the KDE-Desktop 
 GNOME-Look.org Artwork for the GNOME-Desktop 
 Xfce-Look.org Artwork for the Xfce-Desktop 
 Box-Look.org Artwork for your Windowmanager 
 E17-Stuff.org Artwork for Enlightenment 
 Beryl-Themes.org Artwork for the Beryl Windowmanager 
 Compiz-Themes.org Artwork for the Compiz Windowmanager 
 EDE-Look.org Themes for your EDE Desktop 
--
-
 Debian-Art.org Stuff for Debian 
 Gentoo-Art.org Artwork for Gentoo Linux 
 SUSE-Art.org Artwork for openSUSE 
 Ubuntu-Art.org Artwork for Ubuntu 
 Kubuntu-Art.org Artwork for Kubuntu 
 LinuxMint-Art.org Artwork for Linux Mint 
 Arch-Stuff.org Art And Stuff for Arch Linux 
 Frugalware-Art.org Themes for Frugalware 
 Fedora-Art.org Artwork for Fedora Linux 
 Mandriva-Art.org Artwork for Mandriva Linux 
--
-
 KDE-Files.org Files for KDE Applications 
 OpenTemplate.org Documents for OpenOffice.org
 GIMPStuff.org Files for GIMP
 InkscapeStuff.org Files for Inkscape
 ScribusStuff.org Files for Scribus
 BlenderStuff.org Textures and Objects for Blender
 VLC-Addons.org Themes and Extensions for VLC
--
-
 KDE-Help.org Support for your KDE Desktop 
 GNOME-Help.org Support for your GNOME Desktop 
 Xfce-Help.org Support for your Xfce Desktop 
--
openDesktop.orgopenDesktop.org:   Applications   Artwork   Linux Distributions   Documents    LinuxDaily.com    Linux42.org    OpenSkillz.com   
 
Apps
News
Groups
Knowledge
Events
Forum
People
Jobs
Register
Login


Sponsoring


-
- Content .- Fans (6) .- Knowledge Base  . 

Google Translator

   0.6  

Plasmoid Script

Score 86%
Google Translator
zoom


Homepage:  Link
other:  Link
Depends on  KDE 4.x
Downloads:  2950
Submitted:  Oct 17 2009
Updated:  Nov 11 2011

Description:

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

A simple Plasma Widget that lets you translate short sentences using data from Google Translate.

Goggle Translator is programmed in in Python using PyQt and PyKDE4.
Features:

- Simpler, more intuitive (IMHO) and smaller than the Translatiod Plasmoid
(some might not see this as a feature :-)

- Select to and/or 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.3
* python-simplejson
* plasma-scriptengine-python v. 4.5.1

Install the Plasmoid:

plasmapkg -i ./google-translator-.plasmoid

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.

Brazilian Portuguese to English works but English to Brazilian Portuguese doesn't.




Changelog:

- 0.6
The Plasmoid now finally docks in the panel using Plasma.PopupApplet.
Only import required parts of the used modules. The functionalities such
as System Notifications and Network monitoring are now separate classes
which makes the reusable in my other Plasmoids.
Fix for not detecting network on some distributions.
Better feedback on translation and language detection errors.

- 0.5.1
Bug fix release. Accessed an object before it was instantiated.

- 0.5
Added language detection.
Re-factored the code into a reusable base class and a specialized subsclass.
Switch to using simplejson python module.
Minor bug-fix for a character encoding problem which only appeared on
some installations.

- 0.4.3
Improved exception handling.
Notification on network errors.
Some code cleanup.

- 0.4.2
Much improved error handling when no network connection using Solid. The Plasmoid
is now disabled until a connections is established instead of just giving up
and dying ;-)
The Plasmoid is now installed under the "Language" section.

- 0.4.1
Improved KIO handling to be able to handle longer text while at the
same time limit text to 1200 characters to avoid errors on too long
queries.

- 0.4
Added a "Swap languages" button.
TransferJobs are no longer shown in KDE Notifier.

- 0.3.2
Languages weren't sorted after change to KLocale.

- 0.3.1
Quick fix for layout error when adding Plasmoid.

- 0.3
Use KLocale for getting languages. This cuts down on code lines and it will
i18n the language names. Also I don't have to keep up with the number of Google
translations. It's now a race between Google and KDE ;-)
Act on no network connection.
Added nice little Google attribution logo :-)

- 0.2
Finally fixed ComboBoxes dropdown below other widgets!
Code refactoring and cleanup.
Translations automated. For now only Danish translations exists.
Use KIO when getting translation to not block the GUI.
Added Clear Button to text entry field.

- 0.1
Initial version




LicenseGPL
Send to a friend
Subscribe
Other  Apps  from tanghus
Report inappropriate content



goto page: prev   1  2  3 

-

 Script initialization failed

 
 by osovitskiy on: Oct 27 2010
 
Score 50%

Hello!

If I run plasmoid as 'plasmoidviewer google-translator' it starts flawslessly and translates perfectly.

But when I try to add widget with menu "add widget..." I get "Script initialization failed" message and widget doesn't start.

Here is the output of plasmoidviewer:
-----------------------------
bash-4.1$ plasmoidviewer google-translator
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
NetworkMonitor: 1
NetworkMonitor: Connected to network notifier.
NetworkMonitor: Network is connected: False
NetworkMonitor: Current status: Unknown
GoogleTranslatorApplet: Creating main widget.
GoogleTranslator: init
GoogleTranslator: init. Done
QGraphicsLinearLayout::removeAt: invalid index 0
GoogleTranslatorApplet: Not in Panel
GoogleTranslator: configChanged
job_done
Couldn't find node center. Skipping rendering.
Couldn't find node center. Skipping rendering.
job_done
job_done
-----------------------------

P.S. I run Slackware current with KDE 4.5.1, glibc 2.12.1 and python 2.6.4


Best regards,
Oleg Osovitskiy

Reply to this

-

 Re: Script initialization failed

 
 by tanghus on: Oct 27 2010
 
Score 50%

Hi

Could you try to open a Konsole window before you add the Applet and run:

tail -f ~/.xsession-errors

then add the Applet while looking out for any Python tracebacks or whatever else could be related to the script failing.

Thanks for reporting this.


/Thomas
Reply to this

-

 Re: Re: Script initialization failed

 
 by osovitskiy on: Oct 27 2010
 
Score 50%

I have no such file. I created it, but nobody writes to this file when I add the widget.

Sorry for double posting - I updated page in my browser and it added new post. I can't delete it.


Best regards,
Oleg Osovitskiy

Reply to this

-

 Re: Re: Re: Script initialization failed

 
 by tanghus on: Oct 27 2010
 
Score 50%

Quote:
I have no such file. I created it, but nobody writes to this file when I add the widget.


Then replace it with whatever file SlackWare uses to write output from X based programs. Is it maybe called .xinit ?

Quote:
Sorry for double posting - I updated page in my browser and it added new post. I can't delete it.


No problem :-)


/Thomas
Reply to this

-
.

 Re: Re: Re: Re: Script initialization failed

 
 by osovitskiy on: Oct 27 2010
 
Score 50%

Quote:
Then replace it with whatever file SlackWare uses to write output from X based programs. Is it maybe called .xinit ?


Thank you for you great job and for fast support! I restarted my X server and now everything runs flawslessly! You made a good and convinient product, thank you very much!

BTW ~/.xsession-errors file is empty in any case. I'm curious about that fact. But it doesn't matter now =)


Best regards,
Oleg Osovitskiy

Reply to this

-

 Re: Script initialization failed

 
 by tanghus on: Oct 27 2010
 
Score 50%

Quote:
Thank you for you great job and for fast support! I restarted my X server and now everything runs flawslessly! You made a good and convinient product, thank you very much!


I'm glad to hear that it is useful :-)

Quote:
BTW ~/.xsession-errors file is empty in any case. I'm curious about that fact. But it doesn't matter now =)


Weird anyways though. And sometimes it is very handy to be able to see the debug output.


/Thomas
Reply to this

-

 Re: Re: Script initialization failed

 
 by bakaregister on: Nov 1 2010
 
Score 50%

Hi. I'm having a similar problem. The log is as follows:

Quote:

File "/home/ncasabal/.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'
kwin(12678) KWin::Workspace::allowClientActivation: Activation: Belongs to active application
kwin(12678) KWin::Workspace::updateClientArea: screens: 1 desktops: 4
kwin(12678) KWin::Workspace::updateClientArea: Done.
kwin(12678) KWin::Workspace::allowClientActivation: Activation: Belongs to active application
kwin(12678) KWin::Workspace::allowClientActivation: Activation: Belongs to active application
kwin(12678) KWin::Workspace::allowClientActivation: Activation: Belongs to active application
kwin(12678) KWin::Workspace::allowClientActivation: Activation: Belongs to active application
kwin(12678) KWin::Workspace::allowClientActivation: Activation: Belongs to active application
kwin(12678) KWin::Workspace::allowClientActivation: Activation: Belongs to active application
kwin(12678) KWin::Workspace::allowClientActivation: Activation: No client active, allowing
kwin(12678) KWin::Workspace::allowClientActivation: Activation: Belongs to active application
kwin(12678) KWin::Workspace::allowClientActivation: Activation: Belongs to active application
*** NSPlugin Viewer *** WARNING: unhandled variable 18 (<unknown variable>) in NPN_GetValue()
*** NSPlugin Viewer *** WARNING: unhandled variable 18 (<unknown variable>) in NPN_GetValue()
*** NSPlugin Viewer *** WARNING: unhandled variable 18 (<unknown variable>) in NPN_GetValue()
*** NSPlugin Viewer *** WARNING: unhandled variable 18 (<unknown variable>) in NPN_GetValue()
kwin(12678) KWin::Workspace::allowClientActivation: Activation: Belongs to active application


NC
Reply to this

-

 Re: Re: Re: Script initialization failed

 
 by tanghus on: Nov 1 2010
 
Score 50%

Hmm. This shouldn't happen. What KDE version?


/Thomas
Reply to this

-

 Re: Re: Re: Re: Script initialization failed

 
 by bakaregister on: Nov 1 2010
 
Score 50%

Thank you for your prompt answer.

I ran 'kate -v' and obtained the following:
Quote:

Qt: 4.6.2
Plataforma de desarrollo de KDE: 4.4.2 (KDE 4.4.2)
Kate: 3.4.2

uname -r:
Quote:

2.6.32-25-generic


cat /etc/lsb-release:
Quote:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.1 LTS"

python --version
Quote:

Python 2.6.5


Reply to this

-

 Re: Script initialization failed

 
 by tanghus on: Nov 1 2010
 
Score 50%

I have only tested the latest version with KDE SC 4.5.1 so you might want to ugrade your KDE.
There's an excellent step by step explanation here.

http://maketecheasier.com/install-kde-4-5/2010/08/18


/Thomas
Reply to this

-

 Re: Script initialization failed

 
 by tanghus on: Nov 1 2010
 
Score 50%

The Plasma bindings are sometimes a bit of a moving target ;-)


/Thomas
Reply to this

-

 Re: Re: Script initialization failed

 
 by bakaregister on: Nov 3 2010
 
Score 50%

Thanks. After upgrading KDE, it is working.

Notice: if you are behind a proxy, you'll probably need to login as root for adding the PPA; sudo-ing didn't work for me. Try 'sudo su' if you are having problems.



-

 Re: Re: Re: Re: Re: Script initialization failed

 
 by mxttie on: Nov 16 2010
 
Score 50%

I can confirm that the plasmoid is not compatible with kde 4.4.4 either. too bad! Guess I'll have to wait a bit

looks great though


Reply to this

-

 Script initialization failed

 
 by osovitskiy on: Oct 27 2010
 
Score 50%

Hello!

If I run plasmoid as 'plasmoidviewer google-translator' it starts flawslessly and translates perfectly.

But when I try to add widget with menu "add widget..." I get "Script initialization failed" message and widget doesn't start.

Here is the output of plasmoidviewer:
-----------------------------
bash-4.1$ plasmoidviewer google-translator
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
NetworkMonitor: 1
NetworkMonitor: Connected to network notifier.
NetworkMonitor: Network is connected: False
NetworkMonitor: Current status: Unknown
GoogleTranslatorApplet: Creating main widget.
GoogleTranslator: init
GoogleTranslator: init. Done
QGraphicsLinearLayout::removeAt: invalid index 0
GoogleTranslatorApplet: Not in Panel
GoogleTranslator: configChanged
job_done
Couldn't find node center. Skipping rendering.
Couldn't find node center. Skipping rendering.
job_done
job_done
-----------------------------

P.S. I run Slackware current with KDE 4.5.1, glibc 2.12.1 and python 2.6.4


Best regards,
Oleg Osovitskiy

Reply to this

-
.

 Re: Script initialization failed

 
 by anderslund on: Mar 5 2011
 
Score 50%

I have a similar experience with KDE 4.6.1.

Xsession-errors tells me:

Traceback (most recent call last):
File "/usr/share/apps/plasma_scriptengine_python/pyappletscript.py", line 65, in init
self.pyapplet = self.module.__dict__[basename].CreateApplet(None)
AttributeError: 'module' object has no attribute 'CreateApplet'

Runs fine in plasmoidviewer.


Reply to this

-

 Re: Script initialization

 
 by tanghus on: Mar 5 2011
 
Score 50%

Thanks for the report.
These errors are usually some kind of indentation error. Maybe the version I'm running at home (KDE SC 4.6.1) isn't quite in par with the one on kde-look.

I'll put it on my ToDo list to make a minor point release (I'm not really that active on my plasmoids nowadays, sorry).

BTW: Are you sredna on identi.ca?


/Thomas
Reply to this

-
.

 Re: Re: Script initialization

 
 by anderslund on: Mar 5 2011
 
Score 50%

Yes, I am sredna at identi.ca.

I'm sorry I do not know enough about python to figure out where to look for errors. I have another python plasmoid that works fine, if that helps.


Reply to this

-

 Re: Script initializat

 
 by tanghus on: Mar 5 2011
 
Score 50%

OK. I'll have a look at it soonish.


/Thomas
Reply to this

-
.

 Unknown translation error

 
 by heatseeker on: Nov 11 2011
 
Score 50%

Ever since upgrading to KDE 4.7/oneiric I get 'Unknown Translation error!'

The console doesn't report anything suspicious, I only see 'job done'.


Reply to this

-

 Re: Unknown translation error

 
 by tanghus on: Nov 11 2011
 
Score 50%

It hasn't anything to do with Oneiric. 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.
I will update the description accordingly. Thanks for reminding me :-)


Reply to this

-

 Re: Re: Unknown translation error

 
 by heatseeker on: Nov 13 2011
 
Score 50%

ok, too bad :(

thanks anyway!


Reply to this

-
.

 Always errors

 
 by DenisSeidel on: Nov 17 2011
 
Score 50%

One translation and after that always an error. Thats not the way I expect from an google-app.


Reply to this

-

 Re: Always errors

 
 by tanghus on: Nov 17 2011
 
Score 50%

You managed to find this page. Go to the top of it and read what it says.
As for the very rude message you sent me I will report you to the site administrators.
Constructive criticism is welcomed. Insults are not.


Reply to this

goto page: prev   1  2  3 

Add commentBack






-
-
Do you like or dislike Ubuntu Unity?
 Yes, unity is alien technology!
 It is less confusing than Gnome 3 default, shell.
 Granny thinks it is much more usable than Gnome 2
 Canonical is embarrasing itself with this split project
 Gnome 3 default shell is much better
 I dislike Unity, Gnome 3 default shell is alien technology!
 None of the above, I like the 2Gb for free and Apple alike behavior. Will post a comment instead

resultmore
 
 
 Who we are
Contact
More about us
Frequently Asked Questions
Register
Twitter
Blog
Explore
Apps
Jobs
Knowledge
Events
People
Updates on identi.ca
Updates on Twitter
Facebook App
Content RSS   
Events RSS   

Participate
Groups
Forum
Add App
Public API
About KDE-Apps.org
Legal Notice
Spreadshirt Shop
CafePress Shop
Advertising
Sponsor us
Report Abuse
 

Copyright 2003-2014 KDE-Apps.org Team  
All rights reserved. KDE-Apps.org is not liable for any content or goods on this site.
All contributors are responsible for the lawfulness of their uploads.
KDE and K Desktop Environment are trademarks of KDE e.V.