Skip to content

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.


GTranslate library allows you to translate any language to another, the usage is fairly simple.

  1. You just need to require the library
    1. require(“GTranslate.php”);
  2. Instantiate the GTranslate Object
    1. $gt = new Gtranslate;
  3. Request for a translation
    1. $gt->it_to_en(“Ciao mondo”);

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.




Wil give you the same result.


You can download the GTranslate PHP library at Google Code Page


   $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();
Published inRandom Thoughts


Leave a Reply

Your email address will not be published. Required fields are marked *