Jan
Google Translate API – GTranslate PHP Library
Just finished a PHP Library that implements Google Translate API.
How it works ?
The Library allows you to translate any phrase from one original language to another.
Usage
GTranslate library allows you to translate any language to another, the usage is fairly simple.
How to
You can call the translation with any country you want, altough there are an available list of translatable coutries, on the languages.ini file. You can tanslate using the abreviation of the country or the full name.
$gt->english_to_german(“Hello”);
or
$gt->en_to_de(“Hello”);
Wil give you the same result.
Download
You can download the GTranslate PHP library at Google Code Page
http://code.google.com/p/gtranslate-api-php/
Example
require("GTranslate.php"); try{ $gt = new Gtranslate; echo "Translating [Hello World] from English to German =>".$gt->english_to_german("hello world").""; echo "Translating [Ciao mondo] Italian to English => ".$gt->it_to_en("Ciao mondo").""; } catch (GTranslateException $ge) { echo $ge->getMessage(); }
