Skip to main content

CurateClick

github.com favicon

本地离线文字翻译Api

Weekly Pick

基于LibreTranslate封装的本地离线文字翻译Api工具,提供Windows预编译exe包,支持多语言翻译,首次下载模型后即可离线使用,适合新手和小白用户。

Check out 本地离线文字翻译Api on CurateClick

• Copy the embed code to showcase this product on your website

• Share on X to spread the word about this amazing tool

开源地址: https://github.com/jianchang512/ott![image](https://github.com/jianchang512/ott/assets/3378335/97ff6814-4480-4238-b37b-62f84c42204d)**功能概述:**支持多语言的本地离线文字翻译Api工具,基于 LibreTranslate 的封装,目的是提供一个容易在本地机器上直接部署的翻译Api服务,无需docker,并提供 Windows 预编译exe包,不必部署,双击可用,方便新手和小白使用。第一次启动需要下载模型,后续即可离线运行.特点:1. windows提供exe编译包,双击即用无需部署2. Mac Linux 提供本机简单部署方式3. 第一次下载模型后即可离线使用Api接口使用假如你部署的地址和端口是 http://127.0.0.1:9911API地址:http://127.0.0.1:9911/translate支持的语言代码: zh=中文简 zt=中文繁 en=英语 fr=法语 de=德语 ja=日语 ko=韩语 ru=俄语 es=西班牙语 th=泰国语 it=意大利语 pt=葡萄牙语 ar=阿拉伯语 tr=土耳其语 hi=印度语请求方法:POST请求数据: q=待翻译文本,source=文本原始语言代码可填auto自动识别,target=要翻译到的目标语言代码返回数据: 返回json数据,正确时 {translatedText:"翻译后结果"},出错时{error:"错误原因"}python requests 请求示例import requestsresult=requests.post("http://127.0.0.1:9911/translate",json={"q":"你好啊我的朋友","source":"zh","target":"en"})print(result.json())# 输出如下{'translatedText': 'Hello, my friend'}# 错误时返回{'error':'错误原因'}Javascripts fetch请求fetch("http://127.0.0.1:9911/translate", { method: "POST", body: JSON.stringify({ q: "Hello!", // 请求翻译的文本 source: "en",//原始语言,或者填写 'auto' 自动检测 target: "zh"//目标语言 }), headers: { "Content-Type": "application/json" }});// 返回json相应{ "translatedText": "你好!" // translatedText 字段中是翻译后的文本}# 错误时返回{'error':'错误原因'}Javascripts jQuery ajax 请求$.post("http://127.0.0.1:9911/translate", { q: "Hello!", // 请求翻译的文本 source: "en",//原始语言,或者填写 'auto' 自动检测 target: "zh"//目标语言 }, function(res){console.log(res) });// 返回json相应{ "translatedText": "你好!" // translatedText 字段中是翻译后的文本}# 错误时返回{'error':'错误原因'}php curl$data = array( 'q' => 'Hello', 'source' => 'auto', 'target' => 'zh'); $json = json_encode($data);$url = 'http://127.0.0.1:9911/translate';$ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");curl_setopt($ch, CURLOPT_POSTFIELDS, $json);curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($json))); $response = curl_exec($ch);if(curl_errno($ch)) { echo 'Error: ' . curl_error($ch);} else { echo $response;}curl_close($ch);#返回{ "translatedText": "你好!" // translatedText 字段中是翻译后的文本}# 错误时返回{'error':'错误原因'}

Latest Weekly Picks

PlusGO 是面向中国大陆用户的 ChatGPT Plus 代充值服务平台。使用官方 CDKey,支持支付宝和微信扫码支付,平均 2 分钟完成 Plus 开通,自 2025 年起已为超过 10,000 名用户完成充值。

www.toolcenter.ai favicon
Weekly Pick

Discover the Best AI & Productivity Tools — 1,500+ tools with honest reviews.

ToolCenter
huntereyes.net favicon
Weekly Pick

AI Eye Area Evaluation

Hunter Eyes
www.payforchat.com favicon
Weekly Pick

Subscribe to ChatGPT Plus/Pro in 1 minute — no international credit card needed.

PayForChat
happyhorseai.ai favicon
Weekly Pick

Happy Horse AI Creates Videos with Motion and Storytelling

Happy Horse
promptbuilder.cc favicon
Weekly Pick

Generate, optimize, test, and manage AI prompts in one place. Turn an idea into a ready-to-use prompt in seconds.

Prompt Builder
webleadr.com favicon
Weekly Pick

Find and contact web design leads and businesses without websites, like local dentists, effortlessly from any location in just a few clicks.

Webleadr

the art of having something to say