浏览数(8709)
【中文繁简体转换】
中文繁体简体互相转换
url:https://xiv.cm/jf.html
type:POST
data:{"info":"中华民族","code":"F"}
info为要翻译的内容,无长度限制。code为初始内容状态F为繁体,J为简体。
返回:{"status":"ok","info":"中華民族"}
status为状态,ok成功,error失败。info为返回内容。
----------分割线----------
首先必须有获取AK、SK,本站注册后自动获取
Thinkphp的轮子
gibhub:https://github.com/xivcm/xiv
(1)切换到thinphp目录,运行composer require xiv/language
(2)打开vendor/topthink/src/think/Response.php
(3)页头引用use Xiv\xiv;
(4)找到getContent方法
######################
public function getContent(): string
{
if (null == $this->content) {
$content = $this->output($this->data);
if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([$content, '__toString', ]) ) {
throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content)));
}
$this->content = (string) $content;
}
return $this->content;
}
######################
######################
public function getContent(): string
{
if (null == $this->content) {
$content = $this->output($this->data);
if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([ $content, '__toString', ]) ) {
throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content)));
}
$this->content = (string) $content;
}
$xiv=new xiv();
$this->content=$xiv->change($this->content);
return $this->content;
}
######################
其他的去github页面看
----------分割线--------------
WordPress插件:http://i.xiv.cm/wpxiv.zip下载
-----------分割线-------------
Z-Blog散装插件:http://i.xiv.cm/zblogXiv.zip下载
Z-Blog官方插件:http://i.xiv.cm/Xiv.rar下载