PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Outdated profile   Translate with Altavista Babelfish   test.php   Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Usage example script
Class: Translate with Altavista Babelfish
Translates text between idioms using Babelfish
Author: By
Last change:
Date: 20 years ago
Size: 572 bytes
 

Contents

Class file image Download
<html>
<head>
    <title>Translate test</title>
</head>

<body>

<?

   
include "translate_altavista_babelfish.class.php";
   
   
$translate = new translate_babelfish_altavista;
   
   
$string = "Nunca he sabido a ciencia cierta si los traductores online sirven realmente para algo ... o no ...";
   
    if(!
$translated = $translate->translate($string, TRANSLATE_BABELFISH_ALTAVISTA_TRANSLATION_SPANISH_TO_ENGLISH))
        echo
"Translation error.";
    else
    {
        echo
"<b>Original:</b> ".$string."<br>";
        echo
"<b>Translated:</b> ".$translated;
    }
   
?>

</body>
</html>