nofuture17/translate-api
Composer 安装命令:
composer require nofuture17/translate-api
包简介
Client for Yandex.Translate API
README 文档
README
Versioning
Package version corresponds to the version of the API.
Installation
Add into your composer.json:
{
"require": {
"nofuture17/translate-api": "1.5.x"
}
}
Usage
use Yandex\Translate\Translator;
use Yandex\Translate\Exception;
try {
$translator = new Translator($key);
$translation = $translator->translate('Hello world', 'en-ru');
echo $translation; // Привет мир
echo $translation->getSource(); // Hello world;
echo $translation->getSourceLanguage(); // en
echo $translation->getResultLanguage(); // ru
} catch (Exception $e) {
// handle exception
}
License
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-03-26