EasyTranslator
Weekly Pick
基于OpenAI API的命令行翻译工具,支持多种文件格式(如txt、pdf、docx等)的翻译,提供批量处理和调试选项,简化多语言文本翻译流程。
基于OpenAI API的命令行翻译工具,支持多种文件格式(如txt、pdf、docx等)的翻译,提供批量处理和调试选项,简化多语言文本翻译流程。
bashpython easy_translator.py filename [--show] [--tlist] [--azure] [--test]``````bashpython translate_all.py
> 请在.md文档中没有结束标点符号的位置添加英文格式的句号.###### :clap: 说明- filename
: 指定要翻译的文件名,支持 txt、pdf、docx、epub、mobi 格式- --show
: 显示文本翻译过程- --tlist
: 使用译名表- --azure
: 使用 Azure 调用 OpenAI API- --test
: 用于测试翻译效果,翻译三段文字,通常用于调试程序- translate_all.py
:使用脚本 translate_all.py 批量翻译文本 - 首先,请确保文件名的格式为 01_filea.txt, 02_fileb.txt 等,在每个文件名前添加排序前缀 - 其次,请将您想要翻译的文本放置在 book 目录中,如果需要,可以在源代码中修改此目录 - 最后,请注意 Linux 和 Windows 处理事务的方式不同,为了确保正确执行,请根据您的操作系统进入源代码,并取消或注释掉必要部分###### :pushpin: 举例bashpython easy_translator.py ./book/profile.txt``````bashpython easy_translator.py ./book/profile.txt --azure``````bashpython easy_translator.py ./book/profile.pdf --show``````bashpython easy_translator.py ./book/profile.pdf --azure --show``````bashpython easy_translator.py ./book/profile.mobi --show --tlist``````bashpython easy_translator.py ./book/profile.mobi --show --tlist --azure``````bashpython easy_translator.py ./book/profile.epub --show --tlist --test``````bashpython easy_translator.py ./book/profile.epub --show --tlist --azure --test
## :scroll: 仓库及个人联系方式仓库:EasyTranslator领英:LinkedinGithub:Github