OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Product Description Translation Box
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Contributions / Add-Ons > Languages and Zones
Rochdalemark
Does anyone know of a way to integrate Babylons translation code into the product edit page and or category edit column??? The code for the translation box is as follows:

CODE
<script type="text/javascript"> var Babylon_Affiliate = "CD1"; var Babylon_Language = "EN"; document.write('<div id="btrbox">');document.write('<a href="http://www.babylon.com" target="_blank">');document.write('<img src="http://online.babylon.com/trans_box/16.gif"');document.write(' alt="Babylon Online Translator" border="0"></a></div>');</script><script type="text/javascript" src="http://online.babylon.com/trans_box/js/myBabylonBox.js"></script>


Is there anyway to automatically insert into the desired text to translate what you have typed into your default language box, so that all you need to do is select what language you desire and click translate. The translated text needs to open in the same window so you can copy and paste it into your other language edit boxes.

The javascript they point to in myBabylonBox. js is as follows:

CODE
var Babylon_Affiliate;
var Babylon_Language;
var f_width = 120;
var f_height = 111;

var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

function checkIt(string)
{
    place = detect.indexOf(string) + 1;
    thestring = string;
    return place;
}

if (!Babylon_Language) Babylon_Language = "EN";
if (!Babylon_Affiliate) Babylon_Affiliate = "0";

var html = document.getElementById( "btrbox" ).innerHTML;
//if( (html.substring( 0, 44) == '<a href="http://affiliates.babylon.com/z/16/' ) || (html.substring( 0, 44) == '<A href="http://affiliates.babylon.com/z/16/' )) {
//    var URL = "http://online.babylon.com/trans_box/myindex.php?lang=" + Babylon_Language + "&affiliate=" + Babylon_Affiliate;
//    document.write ("<iframe src='" + URL + "' height='" + f_height + "' width='" + f_width + "' FRAMEBORDER='0' marginwidth='0' marginheight='0' vspace='0' hspace='0' allowtransparency='true' scrolling='no'></iframe><BR />");
//}

//alert( html.substring( 0, 186));
//if( (html.substring( 0, 186) == '<a href="http://www.babylon.com" target="_blank"><img src="http://online.babylon.com/trans_box/16.gif" alt="Babylon Online Translator" border="0"></a>' ) || (html.substring( 0, 186) == '<A href="http://www.babylon.com" target=_blank><IMG alt="Babylon Online Translator" src="http://online.babylon.com/trans_box/16.gif" border=0></A>' ) || (html.substring( 0, 186) == '<A href="http://www.babylon.com" target=_blank><IMG alt="Babylon Online Translator" border=0 src="http://online.babylon.com/trans_box/16.gif"></A>' ) ||  (checkIt('opera') != 0 ) ) {

    var URL = "http://online.babylon.com/trans_box/myindex.php?lang=" + Babylon_Language + "&affiliate=" + Babylon_Affiliate;
    document.write ("<iframe src='" + URL + "' height='" + f_height + "' width='" + f_width + "' FRAMEBORDER='0' marginwidth='0' marginheight='0' vspace='0' hspace='0' allowtransparency='true' scrolling='no'></iframe><BR />");
//}


If this is at all possible or if anyone knows a simple way to get translations for there descriptions etc without going to and fro between pages all the time when using multiple languages please let me know.

Regards

Mark
Rochdalemark
Ive found a contribution that does the above, or at least it would if the translation engine it used was still in operation.
It used gummipower.com, but on the bright side it also says that the contribution can be modified to work with google or babelfish translation engines.
Heres the Translation Contribution
Can any coder on here take a look at it and see if it can be altered to run with google or bablefish. Please,,,Pretty please smile.gif
I also know its easy to add a bablefish or google translation box onto your site, but id rather keep people on my own site to view different languages rather than over at babelfish or googles with aframe of my site translated below.

Any help with this would be much appreciated..
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.