Bug 143944 - no translation: google wrong link
Summary: no translation: google wrong link
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Applications
Component: Translator Plugin (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
: 144320 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-04-07 22:46 UTC by Becheru Petru-Ioan
Modified: 2008-11-03 01:05 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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