google / translation-client
Google Translation API Client
Installs: 1 558
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 2
Forks: 0
Open Issues: 0
This package is not auto-updated.
Last update: 2024-12-17 05:12:28 UTC
README
This is a minimalistic API client for Google Translation API
Installation
Installation is conveniently provided via Composer.
To get started, install composer in your project:
$ curl -s https://getcomposer.org/installer | php
Next, add a composer.json file containing the following:
} "require": { "google/translation-client": "dev-master" } }
Finall, install!
$ php composer.phar install
Usage
Using the Google Translation client is easy:
<?php require_once '../src/Client.php'; try { $client = new Goolge_Translate('YOUR API KEY'); $client->setSource('en') ->setTarget('gl') ->setText('If wishes were fishes, we\'d all cast nets') ->translate(); } catch (Exception $e) { echo $e->getMessage(); }