Google Translate API
The preferred way to install this extension is through composer.
Either run
$ php composer.phar require richweber/yii2-google-translate-api "dev-master"
or add
"richweber/yii2-google-translate-api": "dev-master"
to the require
section of your composer.json
file.
If you haven't done so already, create your project's API key by following these steps:
'components' => [
...
'translate' => [
'class' => 'richweber\google\translate\Translation',
'key' => 'INSERT-YOUR-API-KEY',
],
...
],
Yii::$app->translate->translate($source, $target, $text);
Yii::$app->translate->discover();
Yii::$app->translate->detect($text);
yii2-twitter is released under the BSD 3-Clause License. See the bundled LICENSE.md
for details.
Comments