承接 jszsl001/translation 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

jszsl001/translation

最新稳定版本:2.2

Composer 安装命令:

composer require jszsl001/translation

包简介

调用翻译API进行翻译

README 文档

README

translation_api

快速开始

安装

composer require jszsl001/translation

使用

use jszsl001\Translation\Translation;

$text = 'hello world';

$translation = new Translation();
$result = $translation-> translate($text, 'en', 'zh-CN');

var_dump($result);

Demo

<?php
require_once "vendor/autoload.php";

use jszsl001\Translation\Translation;

$text = <<<EOT
    The world is a vast and beautiful place, full of wonder and excitement. There are so many things to see and do, and so many people to meet. We can travel to different countries, learn new languages, and experience different cultures. We can try new foods, meet new people, and make new friends. We can learn new things, expand our horizons, and challenge ourselves. The possibilities are endless.
    So what are you waiting for? Get out there and explore the world! There's a whole world waiting for you to discover.
    EOT;


$translation = new Translation();
$result = $translation
//    -> setChannel('google') // 可选 google, microsoft
//    -> setProxy('http://127.0.0.1:1081') // 可选
    -> translate($text, 'en', 'zh-CN');

var_dump($result);

免责声明

此包仅为教育目的而开发。不要依赖这个包,请下载使用后删除,因为它可能会在任何时候崩溃,因为它是基于爬取谷歌翻译网站。考虑购买官方谷歌翻译API用于其他类型的使用。

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固