justmd5/deeplx
最新稳定版本:v1.7.0
Composer 安装命令:
composer require justmd5/deeplx
包简介
deeplx is a simple and fast free deepl library for PHP.
README 文档
README
deeplx is a simple and fast free deepl library for PHP.
Installing
$ composer require justmd5/deeplx -vvv
Usage
<?php require __DIR__.'/vendor/autoload.php'; $deeplx=new \Justmd5\DeeplX\DeepLTranslator(); try { //translate chinese to english var_dump($deeplx->zh2en("你好")); //output: // array(4) { // ["status"]=> // int(1000) // ["code"]=> // int(1000) // ["message"]=> // string(2) "ok" // ["data"]=> // string(12) "How are you?" // } //translate english to chinese var_dump($deeplx->en2zh("hello my friend.")); //output: //array(4) { // ["status"]=> // int(1000) // ["code"]=> // int(1000) // ["message"]=> // string(2) "ok" // ["data"]=> // string(24) "你好,我的朋友。" //} //normal translate func demo $result = $translator->translate('hello', 'ja')->result(); var_dump($result); //output: //array(4) { // ["status"]=> // int(1000) // ["code"]=> // int(1000) // ["message"]=> // string(2) "ok" // ["data"]=> // string(12) "こんにちわ" //} } catch (Exception $e) { var_dump($e); }
without verify
\Justmd5\DeeplX\DeepLTranslator::withoutVerifying()->en2zh('hello');
Contributing
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- Contribute new features or update the wiki.
The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
License
MIT
统计信息
- 总下载量: 39
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-26