summaryrefslogtreecommitdiffstats
path: root/konq-plugins/babelfish
diff options
context:
space:
mode:
Diffstat (limited to 'konq-plugins/babelfish')
-rw-r--r--konq-plugins/babelfish/Makefile.am26
-rw-r--r--konq-plugins/babelfish/cr16-action-babelfish.pngbin0 -> 790 bytes
-rw-r--r--konq-plugins/babelfish/cr22-action-babelfish.pngbin0 -> 1356 bytes
-rw-r--r--konq-plugins/babelfish/plugin_babelfish.cpp376
-rw-r--r--konq-plugins/babelfish/plugin_babelfish.desktop126
-rw-r--r--konq-plugins/babelfish/plugin_babelfish.h52
-rw-r--r--konq-plugins/babelfish/plugin_babelfish.rc11
-rw-r--r--konq-plugins/babelfish/translaterc15
8 files changed, 606 insertions, 0 deletions
diff --git a/konq-plugins/babelfish/Makefile.am b/konq-plugins/babelfish/Makefile.am
new file mode 100644
index 0000000..3316d68
--- /dev/null
+++ b/konq-plugins/babelfish/Makefile.am
@@ -0,0 +1,26 @@
+INCLUDES = $(all_includes)
+METASOURCES = AUTO
+
+# Install this plugin in the KDE modules directory
+kde_module_LTLIBRARIES = libbabelfishplugin.la
+
+libbabelfishplugin_la_SOURCES = plugin_babelfish.cpp
+libbabelfishplugin_la_LIBADD = $(LIB_KPARTS) $(LIB_KHTML)
+libbabelfishplugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) -no-undefined
+
+pluginsdir = $(kde_datadir)/khtml/kpartplugins
+plugins_DATA = plugin_babelfish.rc plugin_babelfish.desktop
+
+appsdir = $(kde_appsdir)/.hidden
+apps_DATA = plugin_babelfish.desktop
+
+install-data-local: $(srcdir)/../uninstall.desktop
+ $(mkinstalldirs) $(DESTDIR)$(pluginsdir)
+ $(INSTALL_DATA) $(srcdir)/../uninstall.desktop $(DESTDIR)$(pluginsdir)/babelfishplugin.desktop
+
+KDE_ICON = babelfish
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp *.h -o $(podir)/babelfish.pot
+
+kde_conf_DATA = translaterc
diff --git a/konq-plugins/babelfish/cr16-action-babelfish.png b/konq-plugins/babelfish/cr16-action-babelfish.png
new file mode 100644
index 0000000..63ce64d
--- /dev/null
+++ b/konq-plugins/babelfish/cr16-action-babelfish.png
Binary files differ
diff --git a/konq-plugins/babelfish/cr22-action-babelfish.png b/konq-plugins/babelfish/cr22-action-babelfish.png
new file mode 100644
index 0000000..acb9a69
--- /dev/null
+++ b/konq-plugins/babelfish/cr22-action-babelfish.png
Binary files differ
diff --git a/konq-plugins/babelfish/plugin_babelfish.cpp b/konq-plugins/babelfish/plugin_babelfish.cpp
new file mode 100644
index 0000000..302b71a
--- /dev/null
+++ b/konq-plugins/babelfish/plugin_babelfish.cpp
@@ -0,0 +1,376 @@
+/* This file is part of the KDE Project
+ Copyright (C) 2001 Kurt Granroth <granroth@kde.org>
+ Original code: plugin code, connecting to Babelfish and support for selected text
+ Copyright (C) 2003 Rand2342 <rand2342@yahoo.com>
+ Submenus, KConfig file and support for other translation engines
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#include "plugin_babelfish.h"
+
+#include <kaction.h>
+#include <kinstance.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <kconfig.h>
+#include <kgenericfactory.h>
+#include <kaboutdata.h>
+
+#include <khtml_part.h>
+
+typedef KGenericFactory<PluginBabelFish> BabelFishFactory;
+static const KAboutData aboutdata("babelfish", I18N_NOOP("Translate Web Page") , "1.0" );
+K_EXPORT_COMPONENT_FACTORY( libbabelfishplugin, BabelFishFactory( &aboutdata ) )
+
+PluginBabelFish::PluginBabelFish( QObject* parent, const char* name,
+ const QStringList & )
+ : Plugin( parent, name )
+{
+ setInstance(BabelFishFactory::instance());
+
+ m_menu = new KActionMenu( i18n("Translate Web &Page"), "babelfish",
+ actionCollection(), "translatewebpage" );
+ m_menu->setDelayed( false );
+
+ m_en = new KActionMenu( i18n("&English To"), "babelfish",
+ actionCollection(), "translatewebpage_en" );
+ m_fr = new KActionMenu( i18n("&French To"), "babelfish",
+ actionCollection(), "translatewebpage_fr" );
+ m_de = new KActionMenu( i18n("&German To"), "babelfish",
+ actionCollection(), "translatewebpage_de" );
+ m_es = new KActionMenu( i18n("&Spanish To"), "babelfish",
+ actionCollection(), "translatewebpage_es" );
+ m_pt = new KActionMenu( i18n("&Portuguese To"), "babelfish",
+ actionCollection(), "translatewebpage_pt" );
+ m_it = new KActionMenu( i18n("&Italian To"), "babelfish",
+ actionCollection(), "translatewebpage_it" );
+ m_nl = new KActionMenu( i18n("&Dutch To"), "babelfish",
+ actionCollection(), "translatewebpage_nl" );
+
+ m_en->insert( new KAction( i18n("&Chinese (Simplified)"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "en_zh") );
+ m_en->insert( new KAction( i18n("Chinese (&Traditional)"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "en_zhTW") );
+ m_en->insert( new KAction( i18n("&Dutch"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "en_nl") );
+ m_en->insert( new KAction( i18n("&French"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "en_fr") );
+ m_en->insert( new KAction( i18n("&German"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "en_de") );
+ m_en->insert( new KAction( i18n("&Italian"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "en_it") );
+ m_en->insert( new KAction( i18n("&Japanese"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "en_ja") );
+ m_en->insert( new KAction( i18n("&Korean"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "en_ko") );
+ m_en->insert( new KAction( i18n("&Norwegian"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "en_no") );
+ m_en->insert( new KAction( i18n("&Portuguese"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "en_pt") );
+ m_en->insert( new KAction( i18n("&Russian"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "en_ru") );
+ m_en->insert( new KAction( i18n("&Spanish"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "en_es") );
+ m_en->insert( new KAction( i18n("T&hai"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "en_th") );
+
+ m_fr->insert( new KAction( i18n("&Dutch"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "fr_nl") );
+ m_fr->insert( new KAction( i18n("&English"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "fr_en") );
+ m_fr->insert( new KAction( i18n("&German"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "fr_de") );
+ m_fr->insert( new KAction( i18n("&Italian"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "fr_it") );
+ m_fr->insert( new KAction( i18n("&Portuguese"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "fr_pt") );
+ m_fr->insert( new KAction( i18n("&Spanish"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "fr_es") );
+
+ m_de->insert( new KAction( i18n("&English"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "de_en") );
+ m_de->insert( new KAction( i18n("&French"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "de_fr") );
+
+ m_es->insert( new KAction( i18n("&English"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "es_en") );
+ m_es->insert( new KAction( i18n("&French"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "es_fr") );
+
+ m_pt->insert( new KAction( i18n("&English"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "pt_en") );
+ m_pt->insert( new KAction( i18n("&French"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "pt_fr") );
+
+ m_it->insert( new KAction( i18n("&English"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "it_en") );
+ m_it->insert( new KAction( i18n("&French"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "it_fr") );
+
+ m_nl->insert( new KAction( i18n("&English"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "nl_en") );
+ m_nl->insert( new KAction( i18n("&French"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "nl_fr") );
+
+ m_menu->insert( new KAction( i18n("&Chinese (Simplified) to English"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "zh_en") );
+ m_menu->insert( new KAction( i18n("Chinese (&Traditional) to English"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "zhTW_en") );
+ m_menu->insert( m_nl );
+ m_menu->insert( m_en );
+ m_menu->insert( m_fr );
+ m_menu->insert( m_de );
+ m_menu->insert( m_it );
+ m_menu->insert( new KAction( i18n("&Japanese to English"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "ja_en") );
+ m_menu->insert( new KAction( i18n("&Korean to English"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "ko_en") );
+ m_menu->insert( m_pt );
+ m_menu->insert( new KAction( i18n("&Russian to English"), 0,
+ this, SLOT(translateURL()),
+ actionCollection(), "ru_en") );
+ m_menu->insert( m_es );
+ m_menu->setEnabled( true );
+
+ // TODO: we could also support plain text viewers...
+ if ( parent && parent->inherits( "KHTMLPart" ) )
+ {
+ KParts::ReadOnlyPart* part = static_cast<KParts::ReadOnlyPart *>(parent);
+ connect( part, SIGNAL(started(KIO::Job*)), this,
+ SLOT(slotStarted(KIO::Job*)) );
+ }
+}
+
+PluginBabelFish::~PluginBabelFish()
+{
+ delete m_menu;
+}
+
+void PluginBabelFish::slotStarted( KIO::Job* )
+{
+ if ( parent()->inherits("KHTMLPart") &&
+ // Babelfish wants http URLs only. No https.
+ static_cast<KParts::ReadOnlyPart *>(parent())->url().protocol().lower() == "http" )
+ {
+ m_menu->setEnabled( true );
+ }
+ else
+ {
+ m_menu->setEnabled( false );
+ }
+}
+
+void PluginBabelFish::translateURL()
+{
+ // we need the sender() for the language name
+ if ( !sender() )
+ return;
+
+ // The parent is assumed to be a KHTMLPart
+ if ( !parent()->inherits("KHTMLPart") )
+ {
+ QString title = i18n( "Cannot Translate Source" );
+ QString text = i18n( "Only web pages can be translated using "
+ "this plugin." );
+
+ KMessageBox::sorry( 0L, text, title );
+ return;
+ }
+
+ // Select engine
+ KConfig cfg( "translaterc", true );
+ QString engine = cfg.readEntry( sender()->name(), "babelfish" );
+
+ // Get URL
+ KHTMLPart *part = dynamic_cast<KHTMLPart *>(parent());
+ if ( !part )
+ return;
+
+ // we check if we have text selected. if so, we translate that. If
+ // not, we translate the url
+ QString totrans;
+ if ( part->hasSelection() )
+ {
+ if( engine == "reverso" || engine == "tsail" )
+ {
+ KMessageBox::sorry( 0L,
+ i18n( "Only full webpages can be translated for this language pair." ),i18n( "Translation Error" ) );
+ return;
+ }
+ totrans = KURL::encode_string( part->selectedText() );
+ } else {
+ KURL url = part->url();
+ // Check syntax
+ if ( !url.isValid() )
+ {
+ QString title = i18n( "Malformed URL" );
+ QString text = i18n( "The URL you entered is not valid, please "
+ "correct it and try again." );
+ KMessageBox::sorry( 0L, text, title );
+ return;
+ }
+ totrans = KURL::encode_string( url.url() );
+ }
+
+ // Create URL
+ KURL result;
+ QString query;
+ if( engine == "freetranslation" ) {
+ query = "sequence=core&Submit=FREE Translation&language=";
+ if( sender()->name() == QString( "en_es" ) )
+ query += "English/Spanish";
+ else if( sender()->name() == QString( "en_de" ) )
+ query += "English/German";
+ else if( sender()->name() == QString( "en_it" ) )
+ query += "English/Italian";
+ else if( sender()->name() == QString( "en_nl" ) )
+ query += "English/Dutch";
+ else if( sender()->name() == QString( "en_pt" ) )
+ query += "English/Portuguese";
+ else if( sender()->name() == QString( "en_no" ) )
+ query += "English/Norwegian";
+ else if( sender()->name() == QString( "en_zh" ) )
+ query += "English/SimplifiedChinese";
+ else if( sender()->name() == QString( "en_zhTW" ) )
+ query += "English/TraditionalChinese";
+ else if( sender()->name() == QString( "es_en" ) )
+ query += "Spanish/English";
+ else if( sender()->name() == QString( "fr_en" ) )
+ query += "French/English";
+ else if( sender()->name() == QString( "de_en" ) )
+ query += "German/English";
+ else if( sender()->name() == QString( "it_en" ) )
+ query += "Italian/English";
+ else if( sender()->name() == QString( "nl_en" ) )
+ query += "Dutch/English";
+ else if( sender()->name() == QString( "pt_en" ) )
+ query += "Portuguese/English";
+ else // Should be en_fr
+ query += "English/French";
+ if ( part->hasSelection() )
+ {
+ result = KURL( "http://ets.freetranslation.com" );
+ query += "&mode=html&template=results_en-us.htm&srctext=";
+ } else {
+ result = KURL( "http://www.freetranslation.com/web.asp" );
+ query += "&url=";
+ }
+ query += totrans;
+ } else if( engine == "parsit" ) {
+ // Does only English -> Thai
+ result = KURL( "http://c3po.links.nectec.or.th/cgi-bin/Parsitcgi.exe" );
+ query = "mode=test&inputtype=";
+ if ( part->hasSelection() )
+ query += "text&TxtEng=";
+ else
+ query += "html&inputurl=";
+ query += totrans;
+ } else if( engine == "reverso" ) {
+ result = KURL( "http://www.reverso.net/url/frame.asp" );
+ query = "autotranslate=on&templates=0&x=0&y=0&directions=";
+ if( sender()->name() == QString( "de_fr" ) )
+ query += "524292";
+ else if( sender()->name() == QString( "fr_en" ) )
+ query += "65544";
+ else if( sender()->name() == QString( "fr_de" ) )
+ query += "262152";
+ else if( sender()->name() == QString( "de_en" ) )
+ query += "65540";
+ else if( sender()->name() == QString( "en_de" ) )
+ query += "262145";
+ else if( sender()->name() == QString( "en_es" ) )
+ query += "2097153";
+ else if( sender()->name() == QString( "es_en" ) )
+ query += "65568";
+ else if( sender()->name() == QString( "fr_es" ) )
+ query += "2097160";
+ else // "en_fr"
+ query += "524289";
+ query += "&url=";
+ query += totrans;
+ } else if( engine == "tsail" ) {
+ result = KURL( "http://www.t-mail.com/cgi-bin/tsail" );
+ query = "sail=full&lp=";
+ if( sender()->name() == QString( "zhTW_en" ) )
+ query += "tw-en";
+ else if( sender()->name() == QString( "en_zhTW" ) )
+ query += "en-tw";
+ else
+ {
+ query += sender()->name();
+ query[15] = '-';
+ }
+ query += totrans;
+ } else if( engine == "voila" ) {
+ result = KURL( "http://trans.voila.fr/voila" );
+ query = "systran_id=Voila-fr&systran_lp=";
+ query += sender()->name();
+ if ( part->hasSelection() )
+ query += "&systran_charset=utf-8&systran_text=";
+ else
+ query += "&systran_url=";
+ query += totrans;
+ } else {
+ // Using the altavista babelfish engine
+ result = KURL( "http://babelfish.altavista.com/babelfish/tr" );
+ query = "lp=";
+ query += sender()->name();
+ if ( part->hasSelection() )
+ query += "&text=";
+ else
+ query += "&url=";
+ query += totrans;
+ }
+
+ result.setQuery( query );
+
+ // Connect to the fish
+ emit part->browserExtension()->openURLRequest( result );
+}
+
+#include <plugin_babelfish.moc>
diff --git a/konq-plugins/babelfish/plugin_babelfish.desktop b/konq-plugins/babelfish/plugin_babelfish.desktop
new file mode 100644
index 0000000..b412eba
--- /dev/null
+++ b/konq-plugins/babelfish/plugin_babelfish.desktop
@@ -0,0 +1,126 @@
+[Desktop Entry]
+X-KDE-Library=babelfish
+X-KDE-PluginInfo-Author=Kurt Granroth, Rand2342
+X-KDE-PluginInfo-Email=granroth@kde.org, rand2342@yahoo.com
+X-KDE-PluginInfo-Name=babelfish
+X-KDE-PluginInfo-Version=3.3
+X-KDE-PluginInfo-Website=
+X-KDE-PluginInfo-Category=Tools
+X-KDE-PluginInfo-Depends=
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-EnabledByDefault=true
+Name=Babel Plugin
+Name[bg]=Приставка за Babel
+Name[br]=Lugent Babel
+Name[bs]=Babel plugin
+Name[ca]=Connector per a Babel
+Name[cs]=Modul Babel
+Name[de]=Übersetzungsmodul
+Name[el]=Πρόσθετο Babel
+Name[eo]=Babela kromaĵo
+Name[es]=Complemento babel
+Name[et]=Tõlkeplugin
+Name[eu]=Babelen plugina
+Name[fa]=وصلۀ Babel
+Name[fi]=Babel sovelma
+Name[fr]=Module Babel
+Name[fy]=Babel-plugin
+Name[ga]=Breiseán Babel
+Name[gl]=Plugin Babel
+Name[he]=תוסף Babel
+Name[hi]=बेबेल प्लगइन
+Name[hr]=Babel dodatak
+Name[hu]=Babel bővítőmodul
+Name[is]=Babel íforrit
+Name[it]=Plugin per Babel
+Name[ja]=Babel プラグイン
+Name[ka]=Babel მოდული
+Name[kk]=Babel плагин модулі
+Name[km]=កម្មវិធី​ជំនួយ​របស់​ Babel
+Name[lt]=Babel priedas
+Name[mk]=Приклучок Babel
+Name[ms]=Plugin Babel
+Name[nb]=Babel programtillegg
+Name[nds]=Babel-Moduul
+Name[ne]=बाबेल प्लगइन
+Name[nl]=Babel-plugin
+Name[nn]=Programtillegg for Babel
+Name[pa]=ਬਬੀਲ ਪਲੱਗਇਨ
+Name[pl]=Wtyczka programu Babel
+Name[pt]='Plugin' Babel
+Name[pt_BR]=Plug-in Babel
+Name[ru]=Модуль машинного перевода
+Name[sk]=Modul Babel
+Name[sl]=Vstavek Babel
+Name[sr]=Вавилонски прикључак
+Name[sr@Latn]=Vavilonski priključak
+Name[sv]=Babel-insticksprogram
+Name[ta]=பாபேல் சொருகுப் பொருள்
+Name[tg]=Модули тарҷумакунадаи мошинӣ
+Name[tr]=Babel Eklentisi
+Name[uk]=Втулок машинного перекладу
+Name[vi]=Bổ sung Babel
+Name[zh_CN]=Babel 插件
+Name[zh_TW]=Babel外掛程式
+Comment=Babelfish plugin
+Comment[ar]=ملحق Babelfish
+Comment[az]=Babelfish əlavəsi
+Comment[bg]=Приставка за Babelfish
+Comment[br]=Lugent Babelfish
+Comment[ca]=Connector per a Babelfish
+Comment[cs]=Modul Babelfish
+Comment[cy]=Ategyn Babelfish
+Comment[da]=Babelfish-plugin
+Comment[de]=Ein Babelfish-Modul (Übersetzung)
+Comment[el]=Πρόσθετο Babelfish
+Comment[eo]=Babelfiŝo kromaĵo
+Comment[es]=Complemento babelfish
+Comment[et]=Babelfishi plugin
+Comment[eu]=Babelfishen plugina
+Comment[fa]=وصلۀ Babelfish
+Comment[fi]=Babelfish sovelma
+Comment[fo]=Babelsístingur
+Comment[fr]=Module Babelfish
+Comment[fy]=Babelfish-plugin
+Comment[ga]=Breiseán Babelfish
+Comment[gl]=Plugin de Babelfish
+Comment[he]=תוסף Babelfish
+Comment[hi]=बेबेलफिश प्लगइन
+Comment[hr]=Dodatak za Babelfish
+Comment[hu]=Babelfish-bővítőmodul
+Comment[is]=Babelfish íforrit
+Comment[it]=Plugin per Babelfish
+Comment[ja]=Babelfish プラグイン
+Comment[ka]=Babelfish მოდული
+Comment[kk]=Babelfish плагин модулі
+Comment[km]=កម្មវិធី​ជំនួយ​របស់ Babelfish
+Comment[lt]=Babelfish priedas
+Comment[mk]=Приклучок Babelfish
+Comment[ms]= Plug masuk Babelfish
+Comment[nb]=Programtillegg for Babelfish
+Comment[nds]=Babelfish-Moduul
+Comment[ne]=बाबेलफिड प्लगइन
+Comment[nl]=Babelfish-plugin
+Comment[nn]=Programtillegg for Babelfish
+Comment[pa]=ਬਬੀਲਫਿਸ਼ ਪਲੱਗਇਨ
+Comment[pl]=Wtyczka do programu Babelfish
+Comment[pt]='Plugin' do Babelfish
+Comment[pt_BR]=Plugin do Babelfish
+Comment[ro]=Modul Babelfish
+Comment[ru]=Модуль машинного интернет-перевода
+Comment[sk]=Modul Babelfish
+Comment[sl]=Vstavek za Babelfish
+Comment[sr]=Прикључак за Babelfish
+Comment[sr@Latn]=Priključak za Babelfish
+Comment[sv]=Babelfish-insticksprogram
+Comment[ta]=பேபல்பிஷ் சொருகுப்பொருள்
+Comment[tg]=Модули интернет-тарҷумаи мошинӣ
+Comment[tr]=Babelfish eklentisi
+Comment[uk]=Втулок Babelfish
+Comment[vi]=Bổ sung Babelfish
+Comment[xh]=Iplagi yangaphakathi yeBabelfish
+Comment[zh_CN]=Babelfish 插件
+Comment[zh_TW]=Babelfish 外掛程式
+Icon=babelfish
+X-KDE-ParentApp=konqueror
+DocPath=konq-plugins/babel/index.html
diff --git a/konq-plugins/babelfish/plugin_babelfish.h b/konq-plugins/babelfish/plugin_babelfish.h
new file mode 100644
index 0000000..d4e8b01
--- /dev/null
+++ b/konq-plugins/babelfish/plugin_babelfish.h
@@ -0,0 +1,52 @@
+/* This file is part of the KDE Project
+ Copyright (C) 2001 Kurt Granroth <granroth@kde.org>
+ Copyright (C) 2003 Rand2342 <rand2342@yahoo.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef __plugin_babelfish_h
+#define __plugin_babelfish_h
+
+#include <kparts/plugin.h>
+#include <klibloader.h>
+
+class KURL;
+namespace KIO { class Job; }
+
+class PluginBabelFish : public KParts::Plugin
+{
+ Q_OBJECT
+public:
+ PluginBabelFish( QObject* parent, const char* name,
+ const QStringList & );
+ virtual ~PluginBabelFish();
+
+public slots:
+ void translateURL();
+protected slots:
+ void slotStarted( KIO::Job* );
+
+private:
+ KActionMenu* m_menu;
+ KActionMenu* m_de;
+ KActionMenu* m_en;
+ KActionMenu* m_es;
+ KActionMenu* m_fr;
+ KActionMenu* m_it;
+ KActionMenu* m_nl;
+ KActionMenu* m_pt;
+};
+
+#endif
diff --git a/konq-plugins/babelfish/plugin_babelfish.rc b/konq-plugins/babelfish/plugin_babelfish.rc
new file mode 100644
index 0000000..0c1fdb4
--- /dev/null
+++ b/konq-plugins/babelfish/plugin_babelfish.rc
@@ -0,0 +1,11 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="babelfish" library="libbabelfishplugin">
+<MenuBar>
+ <Menu name="tools"><Text>&amp;Tools</Text>
+ <Action name="translatewebpage"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="extraToolBar"><text>Extra Toolbar</text>
+ <Action name="translatewebpage"/>
+</ToolBar>
+</kpartplugin>
diff --git a/konq-plugins/babelfish/translaterc b/konq-plugins/babelfish/translaterc
new file mode 100644
index 0000000..a47760d
--- /dev/null
+++ b/konq-plugins/babelfish/translaterc
@@ -0,0 +1,15 @@
+en_nl=freetranslation
+en_no=freetranslation
+en_ru=voila
+en_th=parsit
+en_zhTW=freetranslation
+es_fr=voila
+fr_it=voila
+fr_nl=voila
+fr_pt=voila
+fr_es=reverso
+it_fr=voila
+nl_en=freetranslation
+nl_fr=voila
+pt_fr=voila
+zhTW_en=tsail