beeyev / yandex-translate
Online service for machine translation for over 40 languages.
Installs: 17 231
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 4
Forks: 6
Open Issues: 1
Requires
- php: >=5.3.0
- ext-curl: *
This package is not auto-updated.
Last update: 2020-06-28 16:20:18 UTC
README
This system is like Bing Translator or Google translate, but api is free for use and without strict limits. API offers text translation features for over 30 languages.
API reference in English / Russian
Don't forget to Get yor own API key
Requirements
- PHP 5.3 or higher
- cURL
Install
Via Composer
$ composer require beeyev/yandex-translate
Usage
use Beeyev\YaTranslate\Translate; try { $tr = new Translate('yourApiKey'); $result = $tr->translate("Hey baby, what are you doing tonight?", 'fr'); echo $result; // Hey bébé, tu fais quoi ce soir? echo $result->sourceText(); // Hey baby, what are you doing tonight? echo $result->translationDirection(); // en-fr var_dump($result->translation()); // array (size=1) // 0 => string 'Hey bébé, tu fais quoi ce soir?' } catch (\Beeyev\YaTranslate\TranslateException $e) { //Handle exception }
License
The MIT License (MIT). Please see License File for more information.