Login   Register  
PHP Classes
elePHPant
Icontem

File: Demo.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2012-11-26 02:35
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>";

}

?>