/google-translate-php

Google Translate API free PHP class. Translates totally free of charge.

Primary LanguagePHP

Google-Translate-PHP

Google Translate API free PHP class. Translates totally free of charge.

Usage

Instantiate GoogleTranslate object

$tr = new GoogleTranslate("en", "ka");

or set/change languages later

$tr = new GoogleTranslate();
$tr->setLangFrom("en");
$tr->setLangTo("ka");

translate sentences

echo $tr->translate("Hello World!");

Also, you can use shorter syntax:

echo $tr->setLangFrom("en")->setLangTo("ru")->translate("Goodbye");

Or call a static method

echo GoogleTranslate::staticTranslate("Hello again", "en", "ka");