dev-master
9999999-devYii2 extension to Yandex Translate API
BSD-3-Clause
The Requires
by BaBL86
api yii2 translate yandex
Yii2 extension to Yandex Translate API
Yandex Translate API, (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
$ php composer.phar require wfstudioru/yii2-yandex-translate-api "dev-master"
or add, (*4)
"wfstudioru/yii2-yandex-translate-api": "dev-master"
to the require
section of your composer.json
file., (*5)
'components' => [ ... 'translate' => [ 'class' => 'wfstudioru\translate\Translation', 'key' => 'INSERT-YOUR-API-KEY', ], ... ],
Yii::$app->translate->translate($source, $target, $text);
Yii::$app->translate->translate('en-US', 'ru-RU', 'Hi everybody!');
the response would be:, (*6)
array ( 'code' => 200, 'lang' => 'en-ru', 'text' => array ( 0 => 'Привет всем!' ) )
Yii2 extension to Yandex Translate API
BSD-3-Clause
api yii2 translate yandex