Skip to content

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

Notifications You must be signed in to change notification settings

handita/google-translate-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 

Repository files navigation

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");

About

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

Resources

Stars

Watchers

Forks

Packages