stajor / yandex-translate
PHP Yandex 翻译 API
1.0.0
2019-05-17 06:20 UTC
Requires
- php: >=7.1
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpunit/phpunit: ^8.0
- vlucas/phpdotenv: ^3.3
This package is auto-updated.
Last update: 2024-09-18 06:12:19 UTC
README
PHP 库,用于 Yandex 翻译 API。
安装
通过 Composer
composer require stajor/yandex-translate
使用
获取支持的语言列表
<?php $translateClient = new Yandex\Translate\TranslateClient('YANDEX-TARNSLATE-TOKEN'); $response = $translateClient->getLangs('en');
语言检测
<?php $translateClient = new Yandex\Translate\TranslateClient('YANDEX-TARNSLATE-TOKEN'); $response = $translateClient->detect('Hello world!');
文本翻译
<?php $translateClient = new Yandex\Translate\TranslateClient('YANDEX-TARNSLATE-TOKEN'); $response = $translateClient->translate('Hello world!', 'ru');
贡献
欢迎在 GitHub 上提交错误报告和拉取请求:https://github.com/Stajor/yandex-translate。此项目旨在成为安全、欢迎的合作空间,并期望贡献者遵守贡献者公约的行为准则。
许可证
此软件库作为开源软件,在MIT 许可证的条款下提供。