summaryrefslogtreecommitdiffstats
path: root/kopete/plugins/translator/translatorplugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/plugins/translator/translatorplugin.cpp')
-rw-r--r--kopete/plugins/translator/translatorplugin.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/kopete/plugins/translator/translatorplugin.cpp b/kopete/plugins/translator/translatorplugin.cpp
index 694f0bd1..4ac8367f 100644
--- a/kopete/plugins/translator/translatorplugin.cpp
+++ b/kopete/plugins/translator/translatorplugin.cpp
@@ -16,6 +16,8 @@
* (at your option) any later version. *
* *
*************************************************************************
+ Patched by Francesco Rossi <redsh@email.it> in order to support new
+ google translation page layout (13-sept-2007)
*/
#include <qapplication.h>
@@ -290,7 +292,8 @@ QString TranslatorPlugin::googleTranslateMessage( const QString &msg, const QStr
// kdDebug( 14308 ) << k_funcinfo << "Google response:"<< endl << data << endl;
- QRegExp re( "<textarea name=q rows=5 cols=45 wrap=PHYSICAL>(.*)</textarea>" );
+// QRegExp re( "<textarea name=q rows=5 cols=45 wrap=PHYSICAL>(.*)</textarea>" );
+ QRegExp re( "<textarea name=utrans wrap=PHYSICAL dilr=ltr rows=5 id=suggestion>(.*)</textarea>");
re.setMinimal( true );
re.search( data );
@@ -325,7 +328,8 @@ QString TranslatorPlugin::babelTranslateMessage( const QString &msg, const QStri
//kdDebug( 14308 ) << k_funcinfo << "Babelfish response: " << endl << data << endl;
- QRegExp re( "<Div style=padding:10px; lang=..>(.*)</div" );
+// QRegExp re( "<Div style=padding:10px; lang=..>(.*)</div" );
+ QRegExp re( "<div style=padding:10px;>(.*)</div>" );
re.setMinimal( true );
re.search( data );
@@ -360,7 +364,7 @@ void TranslatorPlugin::sendTranslation( Kopete::Message &msg, const QString &tra
msg.setBody( translated, msg.format() );
break;
case ShowOriginal:
- msg.setBody( i18n( "%2\nAuto Translated: %1" ).arg( translated, msg.plainBody() ), msg.format() );
+ msg.setBody( i18n( "%2 \nAuto Translated: \n%1" ).arg( translated, msg.plainBody() ), msg.format() );
break;
case ShowDialog:
{