yandextranslator / yandextranslator
is based on the Yandex interpreter. Uses the guzzlle library
1.0.0
2017-12-22 09:26 UTC
Requires
This package is not auto-updated.
Last update: 2024-05-15 02:08:21 UTC
README
is based on the Yandex interpreter. Uses the guzzlle library
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist yandextranslator/yandextranslator "*"
or add
"yandextranslator/yandextranslator": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
<?php use dastanaron\extension\yandextranslator\Translator; $api_key = 'you yandex api key'; $text = "Привет мир"; $translator = new Translator($api_key, $text); $translate = $translator->translate(); echo $translate->getJson(); var_dump($translate->getArray()); echo $translate->etTranslateText(); echo $translate->getTranslatedToUrl();