richweber/yii2-google-translate-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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:

  1. Go to the Google Developers Console.
  2. Select a project, or create a new one.
  3. 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.
  4. In the sidebar on the left, select Credentials.
  5. 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.

Read more...

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

GitHub 信息

  • Stars: 6
  • Watchers: 3
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-01-06