Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 736 Bytes

README.md

File metadata and controls

36 lines (24 loc) · 736 Bytes

free-google-translate

Simple PHP library for talking to Google's Translate API for free.

Installation

Install this package via Composer.

composer require ILYAGVC/free-google-translate

Or edit your project's composer.json to require ILYAGVC/free-google-translateand then runcomposer update`.

"require": {
    "ILYAGVC/free-google-translate": "^1.0.0"
}

Usage

require __DIR__ . 'vendor/autoload.php';
use \ILYAGVC\free-google-translate;

$result = TranslateGoogleFree::Translate("Hello, how are you?", "en", "fa");
if ($result[1] == null) {
    echo $result[0]; // سلام، حال شما چطور است؟
} else {
    echo $result[1]->getMessage();
}