2017 © Pedro Peláez
 

yii2-extension yii2-yandex-translate-api

Yii2 extension to Yandex Translate API

image

wfstudioru/yii2-yandex-translate-api

Yii2 extension to Yandex Translate API

  • Saturday, May 2, 2015
  • by BaBL86
  • Repository
  • 3 Watchers
  • 2 Stars
  • 1,506 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 1 Versions
  • 6 % Grown

The README.md

Yii2 extension to Yandex Translate API

Yandex Translate API, (*1)

Installation

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)

Usage

Create Yandex API Key (free to use)

  1. Go to the Yandex Translate API Site.
  2. Create new API Key.

Component Configuration

'components' => [
    ...
    'translate' => [
        'class' => 'wfstudioru\translate\Translation',
        'key' => 'INSERT-YOUR-API-KEY',
    ],
    ...
],
Yii::$app->translate->translate($source, $target, $text);

Usage

Yii::$app->translate->translate('en-US', 'ru-RU', 'Hi everybody!');

the response would be:, (*6)

array (
    'code' => 200,    
    'lang' => 'en-ru',
    'text' => array (
        0 => 'Привет всем!' 
                   )
      )

The Versions

02/05 2015

dev-master

9999999-dev

Yii2 extension to Yandex Translate API

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar BaBL86

api yii2 translate yandex