pyvideotrans Documentation

Translate the video from one language to another and embed dubbing & subtitles.

RAW Doc

Docker & Self-Hosted Deployment Verified OCI

Deploy pyvideotrans on any server, homelab, or cloud container platform.

1-Click Terminal Command
bash (docker run)
docker run -d --name pyvideotrans -p 7860:7860 --restart always jianchang512/pyvideotrans:latest

File: docs/about.md

👑捐助该项目,助力项目持续维护


本开源项目基于兴趣创建,没有商业计划,也就是你可以一直免费使用,或者fork后自己修改(必须遵守GPL-v3开源协议),不用担心免费版功能受限或闭源安全问题。

至于维护呢,开源嘛都是用爱发电,闲时就多花些精力在这上面,忙时可能就一段时间顾不上了。

当然了,如果觉得该项目对你有价值,希望该项目能一直稳定持续维护和优化,也欢迎各位小额捐助。

如果不愿捐助或者没有能力捐助,也无妨欢迎继续使用,点个star、提交个pr或关注下公众号(内容均是本项目教程,搜一搜公众号pyvideotrans ),也是对开发者的一种帮助。


你可以向微信或支付宝二维码付款,备注你的github名称

Donate URL at ko-fo.com: https://ko-fi.com/jianchang512

[pyVideoTrans项目](https://github.com/jianchang512/pyvideotrans)捐助者列表

感谢所有捐助者,您的支持是我坚持维护的动力

微信支付宝昵称/GitHub用户名 日期 金额
yuppiesnotzhuhao 2023-12-01 捐助10元
9*9 2023-12-02 捐助10元
*s 2023-12-7 捐助 10 元
汪*X 2023-12-10 捐助 0.6 元
*兄 2023-12-12 捐助 1 元
*辰 2023-12-13 捐助 5 元
喵の左爪 2023-12-18 捐助5元
ID:BigD-a-yi 2023-12-20 捐助10元
*D 2023-12-20 捐助 10 元
*溪 2023-12-22 捐助 5 元
*星 2023-12-23 捐助 66 元
F*f 2023-12-24 捐助 10 元
*玲 2023-12-25 捐助 10 元
laowangtou-888 2023-12-25 捐助 100 元
铁* 2023-12-29 捐助 5 元
dingsmart 2024-1-1 捐助 100 元
*王 2024-1-1 捐助 50 元
*想 2024-1-2 捐助 2.88 元
*) 2024-1-6 捐助 50 元
*道 2024-1-6 捐助 20 元
*剑 2024-1-6 捐助 8 元
o*u 2024-1-9 捐助 100 元
o*u 2024-1-9 捐助 100 元
qxk2005 2024-1-9 捐助 100 元
喵の左爪 2024-1-11 捐助10元
*泉 2024-1-11 捐助 6.6 元
*匐 2024-1-11 捐助 20 元
m*o 2024-1-11 捐助 1.0 元
*工 2024-1-12 捐助 10 元
maotouying0102 2024-1-12 捐助 10 元
super5hunz1 2024-1-13 捐助 16.66 元
zhulinzhao 2024-1-14 捐助 5 元
darksiderlyd 2024-1-14 捐助 20 元
againstthewindtofly 2024-1-15 捐助 50 元
wxxvc 2024-1-16 捐助 10 元
喵の左爪 2024-1-16 捐助5元
*眼 2024-1-20 捐助 8.88 元
*工 2024-1-21 捐助 10 元
D* t 2024-1-21 捐助 10 元
L* N 2024-1-23 捐助 5 元
M* 2024-1-24 捐助 10 元
m*l 2024-1-24 捐助 10 元
*生 2024-1-25 捐助 18.88 元
w*d 2024-1-26 捐助 6.66 元
*. 2024-1-27 捐助 0.15 元
vedanthkadam555(ko-fi.com) 2024-1-28 捐助 10 美元
*明 2024-1-29 捐助 20 元
*骁(支付宝) 2024-1-29 捐助 2 元
5*) 2024-1-30 捐助 10 元
rqi14(U*d) 2024-1-30 捐助 200 元
*正 2024-1-30 捐助 10 元
i*8 2024-1-31 捐助 18 元
*. 2024-2-1 捐助 10 元
*途 2024-2-1 捐助 30 元
*甜(bingsunny0730) 2024-2-2 捐助 1.68 元
k*v 2024-2-2 捐助 10 元
*林(xjsszl) 2024-2-2 捐助 10 元
**宇(支付宝) 2024-2-2 捐助 10 元
创新科技(QQ) 2024-2-2 捐助 1.26 元
*彦 2024-2-3 捐助 10 元
*遡 2024-2-6 捐助 20 元
*程(支付宝) 2024-2-6 捐助 50 元
*豪(支付宝) 2024-2-7 捐助 8.8 元
*u 2024-2-8 捐助 20 元
*哦 2024-2-8 捐助 10 元
*u 2024-2-9 捐助 30 元
*许 2024-2-10 捐助 10 元
*伟(支付宝) 2024-2-10 捐助 88.88 元
*明 2024-2-12 捐助 1 元
好*_ 2024-2-14 捐助 22.8 元
t*e 2024-2-14 捐助 28 元
*栎(xigongyue) 2024-2-14 捐助 10 元
a*X 2024-2-14 捐助 8 元
*狗 2024-2-14 捐助 20 元
*种 2024-2-15 捐助 20 元
R*y 2024-2-15 捐助 20 元
R*s 2024-2-15 捐助 20 元
*人 2024-2-16 捐助 18.88 元
*. 2024-2-16 捐助 0.01 元
*喜 2024-2-16 捐助 10 元
*哦 2024-2-17 捐助 10 元
*林 2024-2-19 捐助 100 元
H*p 2024-2-19 捐助 10 元
M*c 2024-2-19 捐助 8.88 元
*飞(支付宝) 2024-2-19 捐助 30 元
*伦(支付宝) 2024-2-19 捐助 100 元
W*l(longwan8888) 2024-2-20 捐助 10 元
D*N 2024-2-20 捐助 11.11 元
*涛 2024-2-20 捐助 50 元
*月 2024-2-21 捐助 2 元
J*y 2024-2-21 捐助 4 元
*军(支付宝) 2024-2-21 捐助 18.88 元
r*r 2024-2-23 捐助 10 元
M*e 2024-2-23 捐助 20 元
*、 2024-2-24 捐助 1 元
*理 2024-2-25 捐助 111 元
*德 2024-2-26 捐助 20 元
*。 2024-2-26 捐助 1 元
l*i 2024-2-26 捐助 10 元
雕个锤子(QQ) 2024-2-26 捐助 15 元
*勇 2024-2-27 捐助 10 元
P*n 2024-2-28 捐助 30 元
*口 2024-2-28 捐助 99 元
0..0(QQ) 2024-2-28 捐助 5 元
*匐 2024-2-29 捐助 28 元
*平 2024-2-29 捐助 10 元
*匐 2024-2-29 捐助 20 元
*吧 2024-2-29 捐助 100 元
Orkun(ko-fi.com) 2024-2-29 捐助 150 美元
*章 2024-3-1 捐助 2 元
*军(支付宝) 2024-3-1 捐助 20 元
孙*9 2024-3-2 捐助 2 元
*叔 2024-3-2 捐助 20 元
d*n(xiongxiong2023) 2024-3-2 捐助 10 元
*匐 2024-3-3 捐助 18 元
*手 2024-3-3 捐助 2 元
*化(huawei250) 2024-3-4 捐助 50 元
B*B 2024-3-4 捐助 15 元
*人 2024-3-4 捐助 18.88 元
煙圈仔(QQ) 2024-3-4 捐助 8.88 元
NNT Music EDM Trending(ko-fi.com) 2024-3-5 捐助 5 美元
h*e 2024-3-5 捐助 1 元
*帅(k576026608) 2024-3-5 捐助 100 元
*华 2024-3-6 捐助 100 元
*菜(badboy-tian) 2024-3-6 捐助 50 元
*鑫 2024-3-6 捐助 20 元
DataGO(QQ) 2024-3-6 捐助 10 元
兔宝宝(QQ) 2024-3-6 捐助 6.66 元
你De世界、只允许有(QQ) 2024-3-6 捐助 10 元
*雨(solielune) 2024-3-7 捐助 199 元
*式 2024-3-8 捐助 10 元
*) 2024-3-8 捐助 10 元
*~ 2024-3-10 捐助 10 元
*雀 2024-3-10 捐助 3 元
JIN LONG(支付宝) 2024-3-12 捐助 99 元
qq碎泪无常 2024-3-13 捐助 10 元
*凯(支付宝) 2024-3-14 捐助 58 元
*杨 2024-3-15 捐助 20 元
*光(Utterlyuseless000) 2024-3-16 捐助 20 元
*端 2024-3-19 捐助 5 元
*彩虹图标 2024-3-20 捐助 88.88 元
D*o 2024-3-20 捐助 20 元
*水 2024-3-20 捐助 5 元
H*o 2024-3-20 捐助 10 元
K*(kevinqingqinga) 2024-3-21 捐助 10 元
M*u 2024-3-22 捐助 10 元
*(dahonghong520) 2024-3-22 捐助 9.99 元
*式(zhangsun972) 2024-3-23 捐助 3 元
*龙(支付宝) 2024-3-23 捐助 10 元
E*c 2024-3-24 捐助 10 元
*鱼(Zonda) 2024-3-24 捐助 23.33 元
C*n 2024-3-24 捐助 100 元
.*.(xincheng213618) 2024-3-24 捐助 10 元
L*G(lrglzm) 2024-3-26 捐助 19.9 元
s*e 2024-3-26 捐助 6.6元
*腻 2024-3-31 捐助 50 元
*哥 2024-3-31 捐助 30 元
*(TigaGUTS) 2024-4-2 捐助 8 元
*郎(machenme) 2024-4-2 捐助 6.66 元
*达 2024-4-2 捐助 6.0 元
**军(支付宝) 2024-4-2 捐助 1 元
l*r 2024-4-3 捐助 5.0 元
*立 2024-4-3 捐助 6.66 元
*晴 2024-4-3 捐助 10 元
a*c 2024-4-3 捐助 2.33 元
T*m 2024-4-4 捐助 100 元
Nguyen Ngoc Thien(kifo.com) 2024-4-4 捐助 $5 美元
*贤 2024-4-5 捐助 20 元
*军 2024-4-5 捐助 50 元
*樱 2024-4-6 捐助 1 元
*赵 2024-4-6 捐助 1 元
*乐 2024-4-6 捐助 10 元
*子 2024-4-11 捐助 10 元
*家 2024-4-20 捐助 9.9 元
*哦 2024-4-21 捐助 10 元
*笔 2024-4-23 捐助 30 元
M*u(LiuVfx) 2024-4-23 捐助 6.66 元
*波(支付宝) 2024-4-23 捐助 88.88 元
*华 2024-4-24 捐助 30 元
*OBJ 2024-4-26 捐助 1 元
M*i 2024-4-28 捐助 28 元
**彬(支付宝) 2024-4-28 捐助 20 元
*籽 2024-4-29 捐助 1 元
*笑 2024-5-1 捐助 2 元
**豹(支付宝) 2024-5-1 捐助 11 元
**豹(支付宝) 2024-5-1 捐助 10 元
*磊 2024-5-4 捐助 2 元
Anthony Tran(ko-fi) 2024-5-4 捐助 $20 美元
*蟹 2024-5-6 捐助 20 元
x*y 2024-5-6 捐助 0.5 元
*曹 2024-5-7 捐助 6 元
*维 2024-5-8 捐助 50 元
*林 2024-5-9 捐助 20 元
**璨(支付宝) 2024-5-9 捐助 5 元
*易 2024-5-10 捐助 5 元
**文(支付宝) 2024-5-10 捐助 100 元
T*n 2024-5-13 捐助 10 元
*娜 2024-5-14 捐助 5 元
*徐 2024-5-14 捐助 9.5 元
*阳(支付宝) 2024-5-15 捐助 30 元
*柯(支付宝) 2024-5-18 捐助 30 元
Q*Q 2024-5-18 捐助 2 元
*旧 2024-5-21 捐助 10 元
小*0 2024-5-22 捐助 10 元
*l 2024-5-22 捐助 10 元
*猪 2024-5-22 捐助 15 元
*成 2024-5-25 捐助 66.6 元
*强 2024-5-26 捐助 20 元
灯光设计吴江南 2024-5-26 捐助 6.66 元
m*g 2024-5-27 捐助 50 元
*亮 2024-5-29 捐助 10 元
*+ 2024-5-30 捐助 0.99 元
*轩(支付宝) 2024-5-31 捐助 20 元
民*5 2024-6-3 捐助 18.8 元
*远 2024-6-3 捐助 6.66 元
*声 2024-6-4 捐助 10 元
*帅(支付宝) 2024-6-4 捐助 1 元
*梁(支付宝) 2024-6-5 捐助 1 元
*刚 2024-6-5 捐助 50 元
z*e 2024-6-5 捐助 5 元
*心 2024-6-5 捐助 20 元
*哥 2024-6-5 捐助 0.1 元
T*y 2024-6-6 捐助 1 元
*怡(支付宝) 2024-6-6 捐助 8 元
*+ 2024-6-6 捐助 19.99 元
*行 2024-6-7 捐助 50 元
*+ 2024-6-7 捐助 19.99 元
*呆 2024-6-8 捐助 5 元
崔*9 2024-6-8 捐助 8.88 元
*聊 2024-6-10 捐助 6.66 元
Q*J 2024-6-11 捐助 20 元
*龙(支付宝) 2024-6-11 捐助 19.9 元
g*g 2024-6-12 捐助 10 元
derbyoen 2024-6-12 捐助 20 元
*海 2024-6-12 捐助 50 元
*哥 2024-6-14 捐助 12 元
T*m(ccynet) 2024-6-14 捐助 20 元
*就 2024-6-15 捐助 88.88 元
*布 2024-6-16 捐助 3 元
*昊 2024-6-17 捐助 6 元
*健(支付宝) 2024-6-17 捐助 10 元
l*G(njzlrjkj) 2024-6-18 捐助 10 元
*、 2024-6-18 捐助 0.88 元
*迷 2024-6-18 捐助 6 元
*唱 2024-6-19 捐助 18 元
*哦(喵の左爪) 2024-6-19 捐助 10 元
*维(支付宝) 2024-6-21 捐助 0.6 元
*齐 2024-6-23 捐助 10 元
*贤 2024-6-24 捐助 9.74 元
L*n 2024-6-27 捐助 1.00 元
*王 2024-6-28 捐助 10.00 元
*钰 2024-6-30 捐助 10.00 元
*㯖 2024-6-30 捐助 1.00 元
张*)(zhangzhiqun) 2024-7-3 捐助 19.99 元
*意 2024-7-5 捐助 10.00 元
J*n(0xouzm) 2024-7-5 捐助 10.00 元
*瑄 2024-7-6 捐助 10.00 元
*子 2024-7-6 捐助 10.00 元
0*8 2024-7-6 捐助 20.00 元
*草(支付宝) 2024-7-6 捐助 50.00 元
*浩(支付宝) 2024-7-6 捐助 20.00 元
*子 2024-7-8 捐助 10.00 元
*哦(喵の左爪) 2024-7-10 捐助 10.00 元
*柳 2024-7-11 捐助 2.00 元
*淳(dcyy-l) 2024-7-11 捐助 10.00 元
*枫 2024-7-11 捐助 10.00 元
*娴 2024-7-11 捐助 10.00 元
s*n 2024-7-11 捐助 5.00 元
*剑 2024-7-13 捐助 6.00 元
*砀(支付宝) 2024-7-14 捐助 14.00 元
*俊 2024-7-15 捐助 10.00 元
J*g 2024-7-15 捐助 10.00 元
*羽(fanvfx2022) 2024-7-16 捐助 18.00 元
*. 2024-7-16 捐助 1.00 元
*生 2024-7-16 捐助 20.00 元
*虎(thinsir) 2024-7-18 捐助 50.00 元
*x(rich360) 2024-7-21 捐助 10.00 元
*开(支付宝) 2024-7-21 捐助 10.00 元
*号(19903110997) 2024-7-21 捐助 10.00 元
*亮(支付宝) 2024-7-24 捐助 10.00 元
*发 2024-7-25 捐助 10.00 元
*轩(支付宝) 2024-7-27 捐助 10.00 元
l*n 2024-7-28 捐助 3.00 元
*丁 2024-7-29 捐助 50.00 元
s*r 2024-7-29 捐助 1.00 元
*璞 2024-7-29 捐助 5.00 元
*繁 2024-7-29 捐助 100.00 元
*言 2024-7-30 捐助 10.00 元
喵の左爪 2024-7-31 捐助 2.5 元
*猫 2024-8-2 捐助 20.00 元
*峰(支付宝) 2024-8-4 捐助 10.00 元
鲁*U 2024-8-9 捐助 10.00 元
*龙(支付宝) 2024-8-12 捐助 1.00 元
*郎 2024-8-12 捐助 20.00 元
n*o 2024-8-12 捐助 5.00 元
m*s(wjcbigwjc) 2024-8-15 捐助 50.00 元
*勇(支付宝) 2024-8-16 捐助 0.01 元
*枝 2024-8-17 捐助 20.00 元
*成 2024-8-19 捐助 1.00 元
*飞(支付宝) 2024-8-19 捐助 10.00 元
*D 2024-8-20 捐助 5.00 元
*根(zhangjiangen11) 2024-8-21 捐助 100.00 元
*人 2024-8-25 捐助 2.00 元
*鹏 2024-8-25 捐助 5.00 元
*博(支付宝) 2024-8-26 捐助 20.00 元
*堂 2024-8-29 捐助 8.8 元
*腾 2024-9-2 捐助 20 元
尤*) 2024-9-3 捐助 20 元
*宇(支付宝) 2024-9-4 捐助 49.9 元
*魂 2024-9-4 捐助 3 元
*鲤(lichuanbin2011) 2024-9-9 捐助 10 元
*源(支付宝) 2024-9-8 捐助 50 元
W*Y 2024-9-9 捐助 6.66 元
F*n 2024-9-10 捐助 10 元
*章 2024-9-10 捐助 2 元
*平 2024-9-11 捐助 10 元
*哦 2024-9-11 捐助 10 元
*国 2024-9-12 捐助 0.55 元
*红 2024-9-12 捐助 0.52 元
*工 2024-9-15 捐助 10 元
*云 2024-9-22 捐助 10 元
H*n 2024-9-22 捐助 20 元
杨*g(Liming) 2024-9-24 捐助 66.6 元
*佳 2024-9-24 捐助 10 元
*℃ 2024-9-25 捐助 20 元
*单 2024-9-29 捐助 10 元
p*k 2024-9-29 捐助 7 元
A*n 2024-9-29 捐助 0.1 元
wilson araujo 2024-9-29 捐助 $5 美元
*。 2024-10-1 捐助 5 元
*钱(支付宝) 2024-10-1 捐助 66 元
*溪 2024-10-3 捐助 33 元
*EXSP 2024-10-4 捐助 18.8 元
*凡 2024-10-4 捐助 10 元
*秋 2024-10-4 捐助 5 元
*焦 2024-10-4 捐助 6 元
*鹏 2024-10-5 捐助 20 元
*骨 2024-10-5 捐助 20 元
* 2024-10-6 捐助 10 元
*仔 2024-10-8 捐助 5 元
* 2024-10-8 捐助 20 元
*璠(支付宝) 2024-10-8 捐助 20 元
*喆(支付宝) 2024-10-9 捐助 50 元
*垠 2024-10-11 捐助 30 元
*仔 2024-10-11 捐助 5 元
*F 2024-10-12 捐助 10 元
Y*S 2024-10-13 捐助 66 元
*淀 2024-10-15 捐助 6.6 元
*章 2024-10-15 捐助 5 元
*宁(支付宝) 2024-10-15 捐助 20 元
*姚 2024-10-16 捐助 15 元
*军(支付宝) 2024-10-16 捐助 1 元
*哦 2024-10-17 捐助 10 元
*兴(支付宝) 2024-10-17 捐助 10 元
*猫 2024-10-18 捐助 6.66 元
*爱 2024-10-18 捐助 10 元
*叶 2024-10-19 捐助 1 元
*磊 2024-10-19 捐助 20 元
*见 2024-10-20 捐助 9.9 元
*山 2024-10-20 捐助 1 元
M*4 2024-10-21 捐助 30 元
月夜 2024-10-21 捐助 100 元
*意 2024-10-22 捐助 10 元
*空 2024-10-22 捐助 5 元
n*n 2024-10-23 捐助 20 元
s*l 2024-10-23 捐助 0.2 元
*中(支付宝) 2024-10-23 捐助 66 元
pyirun* 2024-10-24 捐助 20 元
*元 2024-10-30 捐助 100 元
*哦 2024-10-30 捐助 10 元
*彪(支付宝) 2024-10-31 捐助 1.88 元
*z 2024-11-1 捐助 1 元
* 2024-11-2 捐助 10 元
*瞳(支付宝) 2024-11-3 捐助 10 元
*山 2024-11-4 捐助 10 元
F*n 2024-11-5 捐助 5 元
深蓝广告 2024-11-6 捐助 5 元
a*l 2024-11-7 捐助 10 元
*! 2024-11-7 捐助 10 元
*观2024-11-8 捐助 10 元

[ChatTTS-ui项目](https://github.com/jianchang512/chattts-ui)捐助者列表

微信支付宝昵称/GitHub用户名 日期 金额
T*m(ccynet) 2024-6-14 捐助 10 元

未标注付款方式的即为微信支付,括号内标注为GitHub用户名,感谢所有支持者,软件的每一点进步都离不开您的支持和帮助。


File: docs/googlecloud_tts.md

Google Cloud Text-to-Speech Integration

Overview

This integration adds Google Cloud Text-to-Speech as a new TTS provider in VideoTrans. It offers high-quality voice synthesis with support for multiple languages and voices.

Features

  • Support for 16+ languages including:
    • Portuguese (Brazil)
    • English (US/GB)
    • Spanish
    • French
    • German
    • Italian
    • Japanese
    • Korean
    • Chinese
    • Russian
    • Hindi
    • Arabic
    • Turkish
    • Thai
    • Vietnamese
    • Indonesian
  • Multiple voice options per language
  • Adjustable speaking rate and pitch
  • Support for multiple audio formats (MP3, LINEAR16, OGG_OPUS)
  • User-friendly configuration interface

Requirements

  1. Python package:

    bash
    pip install google-cloud-texttospeech>=2.14.0
  2. Google Cloud Project:

    • Create a project in Google Cloud Console
    • Enable the Cloud Text-to-Speech API
    • Create a service account and download the credentials JSON file

Configuration

  1. In VideoTrans, go to Settings > Google Cloud TTS
  2. Configure the following settings:
    • Credential JSON: Path to your Google Cloud service account credentials file
    • Language: Select the target language (e.g., "pt-BR" for Brazilian Portuguese)
    • Voice: Choose from available voices for the selected language
    • Audio Encoding: Select output format (MP3, LINEAR16, or OGG_OPUS)

Usage

  1. Select "Google Cloud TTS" as your TTS provider
  2. Choose your target language
  3. Select a voice from the available options
  4. Adjust speaking rate and pitch if needed
  5. Proceed with your video translation as usual

Troubleshooting

Common issues and solutions:

  1. "Credentials not found"

    • Verify the path to your credentials JSON file
    • Ensure the file has proper read permissions
  2. "No voices available"

    • Check if your credentials have Text-to-Speech API access
    • Verify if the selected language is supported
    • Check the logs for detailed error messages
  3. "Invalid speaking rate"

    • Speaking rate should be a percentage (e.g., "+10%", "-5%")
    • Default is "+0%"
  4. "Invalid pitch"

    • Pitch should be in Hz (e.g., "+2Hz", "-1Hz")
    • Default is "+0Hz"

Contributing

Feel free to:

  • Report bugs
  • Suggest improvements
  • Add support for more languages
  • Enhance the configuration interface

License

This integration follows the same license as the main VideoTrans project.

Credits

  • Google Cloud Text-to-Speech API
  • VideoTrans team for the base project
  • Contributors who helped with this integration

File: docs/language.md

English

添加语言包

  1. 首先在控制台执行下面代码,查看系统当前语言代码
text
import locale
    locale.getdefaultlocale()[0]

将输出内容的前2个字符小写,拼接上.json作为文件名创建json文件,比如输出的是en_US,就创建 en.json 到 videotrans/language 目录下,这个en.json就是语言文件。

在软件启动时,会以该方式locale.getdefaultlocale()[0]的前2个字符小写,然后拼接.json,组成文件名,到 videotrans/language目录下搜寻,如果存在则使用,不存在则显示英文界面。
如果在 videotrans/set.ini 文件中 lang= 设置了值,则以该值为默认语言代码,否则以 locale.getdefaultlocale() 结果为准。

已存在en.json zh.json 2种语言文件,可直接复制后修改名称,在此基础上制作新的语言文件

每个语言文件都是一个json对象,最外层有4个字段,分别是

text
{
"translate_language":{},
"ui_lang":{},
"toolbox_lang":{}, 
"language_code_list":{}
}

其中 translate_language 是用于进度显示、错误提示、各种交互状态的文本,ui_lang 软件界面各个部件的显示名称,toolbox_lang 是视频工具箱界面各个部件的显示名称, language_code_list 是支持的语言显示名称

translate_language 修改

text
"translate_language": {
    "qianyiwenjian": "The video path or name contains non ASCII spaces. To avoid errors, it has been migrated to ",
    "mansuchucuo": "Video automatic slow error, please try to cancel the 'Video auto down' option",
}

如上,translate_language 是 字段名:字段值 组成的json对象,字段名不要动,字段值改为相应语言的文本即可。

ui_lang 修改

"ui_lang": {
"SP-video Translate Dubbing": "SP-video Translate Dubbing",
"Multiple MP4 videos can be selected and automatically queued for processing": "Multiple MP4 videos can be selected and automatically queued for processing",
"Select video..": "Select video..",
}
同 translate_language 的修改一样,字段名不要动,将字段值改为相应语言的文本即可。

toolbox_lang 修改

"toolbox_lang": {
"No voice video":"无声视频",
"Open dir":"打开目录",
"Audio Wav":"音频文件",
}
同 translate_language 的修改一样,字段名不要动,将字段值改为相应语言的文本即可。

language_code_list 的修改

text
"language_code_list": {
    "zh-cn":"Simplified Chinese",
    "zh-tw":"Traditional Chinese",
    "en":"English",
    "fr":"French",
    "de":"German",
    "ja":"Japanese",
    "ko":"Korean",
    "ru":"Russian",
    "es":"Spanish",
    "th":"Thai",
    "it":"Italian",
    "pt":"Portuguese",
    "vi":"Vietnamese",
    "ar":"Arabic",
    "tr":"Turkish",
    "hi":"Hindi"
  }

和其他一样,该内容字段名不要动,字段值改为要显示的名称

制作完成后,确认符合正确的 json 格式,然后放到 videotrans/language 目录下,重启软件就会自动应用该语言,如何你制作的语言包和默认语言不同,可通过设置 set.ini中 lang=语言代码和强制使用,比如 lang=zh将强制显示 zh.json 内容



Adding Language Packs

  1. First, execute the following code in the console to check the system's current language code
text
import locale
    locale.getdefaultlocale()[0]

Lowercase the first 2 characters of the output content and append .json to create a json file as the filename. For example, if the output is en_US, create en.json in the videotrans/language directory, where en.json is the language file.

When the software starts, the system will take the first 2 characters lowercase from locale.getdefaultlocale()[0] and append .json to form the filename, and then look for it under the videotrans/language directory. If it exists, it will be used; otherwise, the English interface will be displayed.
If the lang= in the videotrans/set.ini file has a value set, then this value will be taken as the default language code, otherwise the result of locale.getdefaultlocale() will be used.

There are already en.json and zh.json 2 language files. You can copy and modify the name directly to create new language files.

Each language file is a json object. The outermost layer has 4 fields, which are

text
{
"translate_language":{},
"ui_lang":{},
"toolbox_lang":{}, 
"language_code_list":{}
}

Here translate_language is used for progress display, error prompts, various interaction states of text, ui_lang software interface display name of each component, toolbox_lang video toolbox interface display name of each component, language_code_list is the supported language display name

Modification of translate_language

text
"translate_language": {
    "qianyiwenjian": "The video path or name contains non ASCII spaces. To avoid errors, it has been migrated to ",
    "mansuchucuo": "Video automatic slow error, please try to cancel the 'Video auto down' option",
}

As mentioned above, translate_language is a json object composed of field name: field value. Do not move the field name and change the field value to the corresponding language text.

Modification of ui_lang

"ui_lang": {
"SP-video Translate Dubbing": "SP-video Translate Dubbing",
"Multiple MP4 videos can be selected and automatically queued for processing": "Multiple MP4 videos can be selected and automatically queued for processing",
"Select video..": "Select video..",
}
The same as the modification of translate_language, do not move the field name and change the field value to the corresponding language text.

Modification of toolbox_lang

"toolbox_lang": {
"No voice video":"Silent video",
"Open dir":"Open directory",
"Audio Wav":"Audio file",
}
The same as the modification of translate_language, do not move the field name, and change the field value to the relevant language text.

Modification of language_code_list

text
"language_code_list": {
    "zh-cn":"Simplified Chinese",
    "zh-tw":"Traditional Chinese",
    "en":"English",
    "fr":"French",
    "de":"German",
    "ja":"Japanese",
    "ko":"Korean",
    "ru":"Russian",
    "es":"Spanish",
    "th":"Thai",
    "it":"Italian",
    "pt":"Portuguese",
    "vi":"Vietnamese",
    "ar":"Arabic",
    "tr":"Turkish",
    "hi":"Hindi"
  }

Like the others, do not modify the field name of this content, change the field value to the display name

After the production is completed, make sure it meets the correct json format, put it into the videotrans/language directory, and the software will automatically apply the language when restarted. If the language pack you made is different from the default language, you can set set.ini in lang= language code and use it forcibly, such as lang=zh will forcibly display the content of zh.json