bluora/laravel-yandex-translate 问题修复 & 功能扩展

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

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

bluora/laravel-yandex-translate

Composer 安装命令:

composer require bluora/laravel-yandex-translate

包简介

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

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License

Build Status StyleCI Test Coverage Issue Count Code Climate

This package is compatible with Laravel 5.

Installation

Install using composer:

composer require bluora/laravel-yandex-translate ~1.0

In config/app.php:

Update the providers section with:

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

Update the aliases section with:

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

In config/services.php:

Add a new third party entry:

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

You can then add YANDEX_TRANSLATE_KEY=myapihere to your .env file.

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:

Привет мир
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.

统计信息

  • 总下载量: 24.78k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-07-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固