|
|
@ -224,7 +224,7 @@ void PluginBabelFish::translateURL()
|
|
|
|
|
|
|
|
|
|
|
|
// Select engine
|
|
|
|
// Select engine
|
|
|
|
TDEConfig cfg( "translaterc", true );
|
|
|
|
TDEConfig cfg( "translaterc", true );
|
|
|
|
TQString engine = cfg.readEntry( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name(), "babelfish" );
|
|
|
|
TQString engine = cfg.readEntry( sender()->name(), "babelfish" );
|
|
|
|
|
|
|
|
|
|
|
|
// Get URL
|
|
|
|
// Get URL
|
|
|
|
TDEHTMLPart *part = dynamic_cast<TDEHTMLPart *>(parent());
|
|
|
|
TDEHTMLPart *part = dynamic_cast<TDEHTMLPart *>(parent());
|
|
|
@ -262,33 +262,33 @@ void PluginBabelFish::translateURL()
|
|
|
|
TQString query;
|
|
|
|
TQString query;
|
|
|
|
if( engine == "freetranslation" ) {
|
|
|
|
if( engine == "freetranslation" ) {
|
|
|
|
query = "sequence=core&Submit=FREE Translation&language=";
|
|
|
|
query = "sequence=core&Submit=FREE Translation&language=";
|
|
|
|
if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "en_es" ) )
|
|
|
|
if( sender()->name() == TQString( "en_es" ) )
|
|
|
|
query += "English/Spanish";
|
|
|
|
query += "English/Spanish";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "en_de" ) )
|
|
|
|
else if( sender()->name() == TQString( "en_de" ) )
|
|
|
|
query += "English/German";
|
|
|
|
query += "English/German";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "en_it" ) )
|
|
|
|
else if( sender()->name() == TQString( "en_it" ) )
|
|
|
|
query += "English/Italian";
|
|
|
|
query += "English/Italian";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "en_nl" ) )
|
|
|
|
else if( sender()->name() == TQString( "en_nl" ) )
|
|
|
|
query += "English/Dutch";
|
|
|
|
query += "English/Dutch";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "en_pt" ) )
|
|
|
|
else if( sender()->name() == TQString( "en_pt" ) )
|
|
|
|
query += "English/Portuguese";
|
|
|
|
query += "English/Portuguese";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "en_no" ) )
|
|
|
|
else if( sender()->name() == TQString( "en_no" ) )
|
|
|
|
query += "English/Norwegian";
|
|
|
|
query += "English/Norwegian";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "en_zh" ) )
|
|
|
|
else if( sender()->name() == TQString( "en_zh" ) )
|
|
|
|
query += "English/SimplifiedChinese";
|
|
|
|
query += "English/SimplifiedChinese";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "en_zhTW" ) )
|
|
|
|
else if( sender()->name() == TQString( "en_zhTW" ) )
|
|
|
|
query += "English/TraditionalChinese";
|
|
|
|
query += "English/TraditionalChinese";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "es_en" ) )
|
|
|
|
else if( sender()->name() == TQString( "es_en" ) )
|
|
|
|
query += "Spanish/English";
|
|
|
|
query += "Spanish/English";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "fr_en" ) )
|
|
|
|
else if( sender()->name() == TQString( "fr_en" ) )
|
|
|
|
query += "French/English";
|
|
|
|
query += "French/English";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "de_en" ) )
|
|
|
|
else if( sender()->name() == TQString( "de_en" ) )
|
|
|
|
query += "German/English";
|
|
|
|
query += "German/English";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "it_en" ) )
|
|
|
|
else if( sender()->name() == TQString( "it_en" ) )
|
|
|
|
query += "Italian/English";
|
|
|
|
query += "Italian/English";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "nl_en" ) )
|
|
|
|
else if( sender()->name() == TQString( "nl_en" ) )
|
|
|
|
query += "Dutch/English";
|
|
|
|
query += "Dutch/English";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "pt_en" ) )
|
|
|
|
else if( sender()->name() == TQString( "pt_en" ) )
|
|
|
|
query += "Portuguese/English";
|
|
|
|
query += "Portuguese/English";
|
|
|
|
else // Should be en_fr
|
|
|
|
else // Should be en_fr
|
|
|
|
query += "English/French";
|
|
|
|
query += "English/French";
|
|
|
@ -313,21 +313,21 @@ void PluginBabelFish::translateURL()
|
|
|
|
} else if( engine == "reverso" ) {
|
|
|
|
} else if( engine == "reverso" ) {
|
|
|
|
result = KURL( "http://www.reverso.net/url/frame.asp" );
|
|
|
|
result = KURL( "http://www.reverso.net/url/frame.asp" );
|
|
|
|
query = "autotranslate=on&templates=0&x=0&y=0&directions=";
|
|
|
|
query = "autotranslate=on&templates=0&x=0&y=0&directions=";
|
|
|
|
if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "de_fr" ) )
|
|
|
|
if( sender()->name() == TQString( "de_fr" ) )
|
|
|
|
query += "524292";
|
|
|
|
query += "524292";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "fr_en" ) )
|
|
|
|
else if( sender()->name() == TQString( "fr_en" ) )
|
|
|
|
query += "65544";
|
|
|
|
query += "65544";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "fr_de" ) )
|
|
|
|
else if( sender()->name() == TQString( "fr_de" ) )
|
|
|
|
query += "262152";
|
|
|
|
query += "262152";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "de_en" ) )
|
|
|
|
else if( sender()->name() == TQString( "de_en" ) )
|
|
|
|
query += "65540";
|
|
|
|
query += "65540";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "en_de" ) )
|
|
|
|
else if( sender()->name() == TQString( "en_de" ) )
|
|
|
|
query += "262145";
|
|
|
|
query += "262145";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "en_es" ) )
|
|
|
|
else if( sender()->name() == TQString( "en_es" ) )
|
|
|
|
query += "2097153";
|
|
|
|
query += "2097153";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "es_en" ) )
|
|
|
|
else if( sender()->name() == TQString( "es_en" ) )
|
|
|
|
query += "65568";
|
|
|
|
query += "65568";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "fr_es" ) )
|
|
|
|
else if( sender()->name() == TQString( "fr_es" ) )
|
|
|
|
query += "2097160";
|
|
|
|
query += "2097160";
|
|
|
|
else // "en_fr"
|
|
|
|
else // "en_fr"
|
|
|
|
query += "524289";
|
|
|
|
query += "524289";
|
|
|
@ -336,20 +336,20 @@ void PluginBabelFish::translateURL()
|
|
|
|
} else if( engine == "tsail" ) {
|
|
|
|
} else if( engine == "tsail" ) {
|
|
|
|
result = KURL( "http://www.t-mail.com/cgi-bin/tsail" );
|
|
|
|
result = KURL( "http://www.t-mail.com/cgi-bin/tsail" );
|
|
|
|
query = "sail=full&lp=";
|
|
|
|
query = "sail=full&lp=";
|
|
|
|
if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "zhTW_en" ) )
|
|
|
|
if( sender()->name() == TQString( "zhTW_en" ) )
|
|
|
|
query += "tw-en";
|
|
|
|
query += "tw-en";
|
|
|
|
else if( TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name() == TQString( "en_zhTW" ) )
|
|
|
|
else if( sender()->name() == TQString( "en_zhTW" ) )
|
|
|
|
query += "en-tw";
|
|
|
|
query += "en-tw";
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
query += TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name();
|
|
|
|
query += sender()->name();
|
|
|
|
query[15] = '-';
|
|
|
|
query[15] = '-';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
query += totrans;
|
|
|
|
query += totrans;
|
|
|
|
} else if( engine == "voila" ) {
|
|
|
|
} else if( engine == "voila" ) {
|
|
|
|
result = KURL( "http://trans.voila.fr/voila" );
|
|
|
|
result = KURL( "http://trans.voila.fr/voila" );
|
|
|
|
query = "systran_id=Voila-fr&systran_lp=";
|
|
|
|
query = "systran_id=Voila-fr&systran_lp=";
|
|
|
|
query += TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name();
|
|
|
|
query += sender()->name();
|
|
|
|
if ( part->hasSelection() )
|
|
|
|
if ( part->hasSelection() )
|
|
|
|
query += "&systran_charset=utf-8&systran_text=";
|
|
|
|
query += "&systran_charset=utf-8&systran_text=";
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -359,7 +359,7 @@ void PluginBabelFish::translateURL()
|
|
|
|
// Using the altavista babelfish engine
|
|
|
|
// Using the altavista babelfish engine
|
|
|
|
result = KURL( "http://babelfish.altavista.com/babelfish/tr" );
|
|
|
|
result = KURL( "http://babelfish.altavista.com/babelfish/tr" );
|
|
|
|
query = "lp=";
|
|
|
|
query = "lp=";
|
|
|
|
query += TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name();
|
|
|
|
query += sender()->name();
|
|
|
|
if ( part->hasSelection() )
|
|
|
|
if ( part->hasSelection() )
|
|
|
|
query += "&text=";
|
|
|
|
query += "&text=";
|
|
|
|
else
|
|
|
|
else
|
|
|
|