richweber/yii2-google-translate-api
最新稳定版本:1.0.0
Composer 安装命令:
composer require richweber/yii2-google-translate-api
包简介
Yii2 extension to Google Translate API
关键字:
README 文档
README
Google Translate API
Installation
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.
Usage
Identifying your application to Google
If you haven't done so already, create your project's API key by following these steps:
- Go to the Google Developers Console.
- Select a project, or create a new one.
- In the sidebar on the left, expand APIs & auth. Next, click APIs. In the list of APIs, make sure the status is ON for the Google Translate API.
- In the sidebar on the left, select Credentials.
- To create an API key, click Create new Key and select the appropriate key type. Enter the additional information required for that key type and click Create.
Component Configuration
'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);
License
yii2-twitter is released under the BSD 3-Clause License. See the bundled LICENSE.md for details.
统计信息
- 总下载量: 41.75k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2015-01-06