Bug 143944

Summary: no translation: google wrong link
Product: [Unmaintained] kopete Reporter: Becheru Petru-Ioan <becheru.petru.ioan>
Component: Translator PluginAssignee: Kopete Developers <kopete-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: kde, m.debruijne, vendion
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Becheru Petru-Ioan 2007-04-07 22:46:13 UTC
Version:           0.12.4 (using KDE 3.5.6, Debian Package 4:3.5.6.r1.dfsg.1-2 (4.0))
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.18-4-k7

in function TranslatorPlugin::googleTranslateMessage from translatorplugin.cpp you use this formula to build the link to google translator:
"http://translate.google.com/translate_t?text=" + body +"&langpair=" + lp
where yout lp has the form "<lang1>_<lang2>".
For examample for text="hello" and lp="en_it"(english to italian) the link is: http://translate.google.com/translate_t?text=hello&langpair=en_it and IT DOES NOT WORK(click it to see). KOpete outputs: "Very strange! got a DCOPReply opcode, but we were not waiting for a reply!
kopete (translator): WARNING: [void TranslatorPlugin::sendTranslation(Kopete::Message&, const QString&)] Translated text is empty"

---FIX---
The correct link is : http://translate.google.com/translate_t?text=hello&langpair=en|it (click to see).

lp should be constructed "<lang1>|<lang2>" ("|" instead of "_": example "en|it" instead of "en_it") .
Comment 1 Philip Rodrigues 2007-04-18 00:27:49 UTC
*** Bug 144320 has been marked as a duplicate of this bug. ***
Comment 2 Nicolas L. 2008-11-03 01:05:49 UTC
now we have in latest kopete :

QString lp = from + '|' + to;

so closing this bug report