2017 © Pedro Peláez
 

library laravel-yandex-translate

Translate a word or text to a given language using Yandex Translation service.

image

bluora/laravel-yandex-translate

Translate a word or text to a given language using Yandex Translation service.

  • Monday, September 26, 2016
  • by bluora
  • Repository
  • 3 Watchers
  • 2 Stars
  • 1,162 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 17 % Grown

The README.md

Yandex Translate Provider for Laravel 5

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Build Status StyleCI Test Coverage Issue Count Code Climate, (*2)

This package is compatible with Laravel 5.

Installation

Install using composer:, (*3)

composer require bluora/laravel-yandex-translate ~1.0

In config/app.php:, (*4)

Update the providers section with:, (*5)

'providers' => [
    ...
    Bluora\Yandex\Providers\YandexTranslateServiceProvider::class,
)

Update the aliases section with:, (*6)

'aliases' => [
    ...
    'YandexTranslate' => Bluora\Yandex\Facades\YandexTranslateFacade::class,
]

In config/services.php:, (*7)

Add a new third party entry:, (*8)

return [
    ...
    'yandex-translate' => [
        'key' => env('YANDEX_TRANSLATE_KEY', ''),
    ]
];

You can then add YANDEX_TRANSLATE_KEY=myapihere to your .env file., (*9)

Usage

echo YandexTranslate::translate('Hello world', 'en', 'ru');
echo YandexTranslate::translate('Hello world!', 'en', 'fr');
echo YandexTranslate::translate('Hello world!', false, 'fr');
echo YandexTranslate::translate('Hello world!', false, 'fr')->getOriginalLanguage();
print_r(YandexTranslate::translate(['Hello world!', 'I love you'], 'en', 'fr'));
print_r(YandexTranslate::translate([22 => 'Hello world!', 30 => 'I love you'], 'en', 'fr'));
print_r(YandexTranslate::translate(['first_word' => 'Hello world!', 'second_word' => 'I love you'], 'en', 'fr'));

Would output:, (*10)

Привет мир
Bonjour tout le monde!
Bonjour tout le monde!
en
Array
(
    [0] => Bonjour tout le monde!
    [1] => Je vous aime
)
Array
(
    [22] => Bonjour tout le monde!
    [30] => Je vous aime
)
Array
(
    ['first_word'] => Bonjour tout le monde!
    ['second_word'] => Je vous aime
)

Yandex API Key

You can get your API key here., (*11)

The Versions

26/09 2016

dev-master

9999999-dev

Translate a word or text to a given language using Yandex Translation service.

  Sources   Download

MIT

The Requires

  • ext-curl *
  • php >=5.5.0

 

The Development Requires

by Nikita Gusakov

laravel translation yandex

22/07 2016

v1.0.3

1.0.3.0

Translate a word or text to a given language using Yandex Translation service.

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-curl *

 

The Development Requires

by Nikita Gusakov

laravel translation yandex

22/07 2016

v1.0.2

1.0.2.0

Translate a word or text to a given language using Yandex Translation service.

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-curl *

 

The Development Requires

by Nikita Gusakov

laravel translation yandex

22/07 2016

v1.0.1

1.0.1.0

Translate a word or text to a given language using Yandex Translation service.

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-curl *

 

The Development Requires

by Nikita Gusakov

laravel translation yandex

22/07 2016

v1.0.0

1.0.0.0

Translate a word or text to a given language using Yandex Translation service.

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-curl *

 

The Development Requires

by Nikita Gusakov

laravel translation yandex