summaryrefslogtreecommitdiffstats
path: root/kopete/plugins/translator
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-13 06:26:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-13 06:26:27 +0000
commit9fab5b8a216e283e563f3457315715672bc8b55a (patch)
treec1251952e4e0e28fad0bca829d49335ff15b6e98 /kopete/plugins/translator
parentbcb704366cb5e333a626c18c308c7e0448a8e69f (diff)
downloadtdenetwork-9fab5b8a216e283e563f3457315715672bc8b55a.tar.gz
tdenetwork-9fab5b8a216e283e563f3457315715672bc8b55a.zip
Update to Trinity 3.5.11
Will need to watch for commit warnings and rebuild test git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1061808 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/plugins/translator')
-rw-r--r--kopete/plugins/translator/translatorlanguages.cpp40
-rw-r--r--kopete/plugins/translator/translatorplugin.cpp10
2 files changed, 27 insertions, 23 deletions
diff --git a/kopete/plugins/translator/translatorlanguages.cpp b/kopete/plugins/translator/translatorlanguages.cpp
index 4e59fa79..d0a1e0a0 100644
--- a/kopete/plugins/translator/translatorlanguages.cpp
+++ b/kopete/plugins/translator/translatorlanguages.cpp
@@ -29,7 +29,7 @@ TranslatorLanguages::TranslatorLanguages()
{
m_lc = 0;
m_sc = 0;
- m_services.insert("babelfish", "BabelFish");
+// m_services.insert("babelfish", "BabelFish");
m_services.insert("google", "Google");
m_langs.insert("null", i18n("Unknown"));
@@ -45,29 +45,29 @@ TranslatorLanguages::TranslatorLanguages()
m_langs.insert("es", i18n("Spanish"));
/* English to .. */
- m_supported["babelfish"].append("en_zh");
- m_supported["babelfish"].append("en_fr");
- m_supported["babelfish"].append("en_de");
- m_supported["babelfish"].append("en_it");
- m_supported["babelfish"].append("en_ja");
- m_supported["babelfish"].append("en_ko");
- m_supported["babelfish"].append("en_pt");
- m_supported["babelfish"].append("en_es");
+// m_supported["babelfish"].append("en_zh");
+// m_supported["babelfish"].append("en_fr");
+// m_supported["babelfish"].append("en_de");
+// m_supported["babelfish"].append("en_it");
+// m_supported["babelfish"].append("en_ja");
+// m_supported["babelfish"].append("en_ko");
+// m_supported["babelfish"].append("en_pt");
+// m_supported["babelfish"].append("en_es");
/* Chinese to .. */
- m_supported["babelfish"].append("zh_en");
+// m_supported["babelfish"].append("zh_en");
/* French to ... */
- m_supported["babelfish"].append("fr_en");
- m_supported["babelfish"].append("fr_de");
+// m_supported["babelfish"].append("fr_en");
+// m_supported["babelfish"].append("fr_de");
/* German to ... */
- m_supported["babelfish"].append("de_en");
- m_supported["babelfish"].append("de_fr");
+// m_supported["babelfish"].append("de_en");
+// m_supported["babelfish"].append("de_fr");
- m_supported["babelfish"].append("it_en");
- m_supported["babelfish"].append("ja_en");
- m_supported["babelfish"].append("ko_en");
- m_supported["babelfish"].append("pt_en");
- m_supported["babelfish"].append("ru_en");
- m_supported["babelfish"].append("es_en");
+// m_supported["babelfish"].append("it_en");
+// m_supported["babelfish"].append("ja_en");
+// m_supported["babelfish"].append("ko_en");
+// m_supported["babelfish"].append("pt_en");
+// m_supported["babelfish"].append("ru_en");
+// m_supported["babelfish"].append("es_en");
/* Google Service */
m_supported["google"].append("en_de");
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:
{