PHP Classes

File: Demo.php

Recommend this page to a friend!
  Classes of K.S.Richard   Google Auto Translate   Demo.php   Download  
File: Demo.php
Role: Example script
Content type: text/plain
Description: Demo for translation
Class: Google Auto Translate
Translate text using the Google Translate site
Author: By
Last change:
Date: 12 years ago
Size: 618 bytes
 

Contents

Class file image Download

<form name="lap" method="post" action="">
Translate from any language ( with auto language detection ) to english:<br />
<input type="text" name="szo" /><br />
<input type="submit" value="Translate!" />
</form>





<?php

if( (isset($_POST['szo'])) && ($_POST['szo']!="") ){

include
"GoogleAutoTranslate.class.php";

$g=new GoogleAutoTranslate();
$translate=$g->translate_to("".$_POST['szo']."","en"); // this string will contains the translated string in your language
print "Original text : <br /><b>" . $_POST['szo']."</b><br /><br /> Translated text : <br /><b>".$translate."</b>";

}

?>