Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

【工具自荐】EasyTranslator - 基于ChatGPT的多语言翻译助手 #3760

Open
artwalker opened this issue Dec 19, 2023 · 0 comments
Open
Labels

Comments

@artwalker
Copy link

artwalker commented Dec 19, 2023

📑 介绍

利用 OpenAI API 打造的命令行工具,支持多种格式文件的翻译,包括 .txt、.pdf、.docx、.md、.mobi 和 .epub。
轻松快捷地翻译您的文本文件,让语言不再成为阻碍。

🏃 使用方法

python easy_translator.py filename [--show] [--tlist] [--azure] [--test]
python translate_all.py

请在.md文档中没有结束标点符号的位置添加英文格式的句号.

👏 说明
  • 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 处理事务的方式不同,为了确保正确执行,请根据您的操作系统进入源代码,并取消或注释掉必要部分

📌 举例
python easy_translator.py ./book/profile.txt
python easy_translator.py ./book/profile.txt --azure
python easy_translator.py ./book/profile.pdf --show
python easy_translator.py ./book/profile.pdf --azure --show
python easy_translator.py ./book/profile.mobi --show --tlist
python easy_translator.py ./book/profile.mobi --show --tlist --azure
python easy_translator.py ./book/profile.epub --show --tlist --test
python easy_translator.py ./book/profile.epub --show --tlist --azure --test

📜 仓库及个人联系方式

仓库:EasyTranslator
领英:Linkedin
Github:Github

@artwalker artwalker changed the title 【工具自荐】EasyTranslator基于ChatGPT的多言翻译助手 【工具自荐】EasyTranslator - 基于ChatGPT的多语言翻译助手 Dec 19, 2023
@ruanyf ruanyf added the weekly label Dec 19, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants