PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of solomongaby   Google Translate Tool   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: example file
Class: Google Translate Tool
Translate text or Web pages using Google Translate
Author: By
Last change:
Date: 16 years ago
Size: 522 bytes
 

Contents

Class file image Download
<?php

require('googleTranslateTool.class.php');

// initiate the translator with the settings from english to spanish, for full language list check the main class file
$translator = new googleTranslateTool('en','es');

$result = $translator->translate_Text('Hello, this is a test of a translation');

if (
$result===false ) echo $translator->return_error();
else echo
$result;

$result = $translator->translate_URL('http://www.yahoo.com/');

if (
$result===false ) echo $translator->return_error();
else echo
$result;

?>