Visitar URL original
pdf2zh 2.0 · Issue #586 · PDFMathTranslate/PDFMathTranslate · GitHub
Skip to content

pdf2zh 2.0 #586

Closed
1 of 1 issue completed
Closed

Description

@awwaawwa

Note

2.0 Moved to a new repository under the organization: PDFMathTranslate/PDFMathTranslate-next

Background

PDF2ZH consists of the following parts:

  1. Core: I am completely rewriting it, related code is at https://github.com/funstory-ai/BabelDOC
  2. Configuration System
  3. GUI
  4. Translator Support

The current PDF2ZH code is difficult to maintain. I hope to completely rewrite all parts of PDF2ZH except for the translator to improve both user and developer experience.

BabelDOC Preview

Image

Project Positioning

BabelDOC serves as a PDF translation library providing core translation functionality.

PDF2ZH handles self-deployment related tasks, such as GUI, better configuration system, better initial guidance, multi-language localization, etc.

Roadmap

  • Experimental support for BabelDOC in CLI and GUI
  • Stop adding new features to the legacy backend
  • Refactor the configuration system
  • Improve GUI
  • Switch documentation to mkdocs
  • Provide a more user-friendly http api
  • Integration Testing
  • Completely remove the legacy backend after BabelDOC is perfected
  • ...

Specific Details

Requires further research & discussion.

Activity

  1. awwaawwa commented on Feb 9, 2025

    @awwaawwa
    CollaboratorAuthor

    For the configuration system, I want:

    1. Support CLI parameters
    2. Support environment variables
    3. Support configuration files
    4. Support modifying all configurations in GUI

    For the GUI, I hope to have a comprehensive beginner's guide. And it would be best to have a complete packaging solution, aiming to achieve one-click startup with a double-click .exe file, and then complete all operations within the GUI.

  2. added this to the v2.0.0 milestone on Feb 16, 2025
  3. awwaawwa commented on Feb 22, 2025

    @awwaawwa
    CollaboratorAuthor

    GUI needs good localization support. Export all UI strings.

  4. pinned this issue on Feb 22, 2025
  5. changed the title [-]Refactoring: Rewrite all parts of PDF2ZH except the translator to improve user experience and developer experience.[/-] [+]pdf2zh 2.0: Rewrite all parts of PDF2ZH except the translator to improve user experience and developer experience.[/+] on Feb 22, 2025
  6. hellofinch commented on Feb 24, 2025

    @hellofinch
    Collaborator

    weblate is all you need.

  7. unpinned this issue on Mar 1, 2025
  8. pinned this issue on Mar 9, 2025
  9. awwaawwa commented on Mar 11, 2025

    @awwaawwa
    CollaboratorAuthor

    After pdf2zh 2.0 is released, explain the relationship between memory usage and page count in the readme.

  10. awwaawwa commented on Mar 11, 2025

    @awwaawwa
    CollaboratorAuthor

    GUI may need to consider supporting automatic PDF splitting for translation, and then merging back together.

  11. 31 remaining items

  12. awwaawwa commented on May 17, 2025

    @awwaawwa
    CollaboratorAuthor

    2025-5-17
    https://github.com/awwaawwa/PDFMathTranslate/actions/runs/15073554383 https://github.com/awwaawwa/PDFMathTranslate/pkgs/container/pdfmathtranslate
    Synchronized BabelDOC 0.3.50, now supports Python 3.13. The exe and docker versions are also built based on Python 3.13. However, I have only tested the source code + Python 3.13 locally on my computer and it runs normally. I would appreciate it if the community could help test the exe and docker versions~

    显示没有找到段落,试了好几个pdf都一样,包括以前正常可用的2.0版本(5月9号左右的版本)成功翻译过的文件 traceback.txt

    原文件发一下?

    直接发个新issue吧,记得用对模版+完整填写

  13. awwaawwa commented on May 20, 2025

    @awwaawwa
    CollaboratorAuthor

    2025-5-20

    更正硅基流动名称
    移除deeplx支持
    本次更新是一次破坏性更新,此版本对配置文件格式有所调整(移除deeplx相关配置,调整tmt配置,调整硅基流动配置)。
    现在默认的配置文件已变更为 ~/.config/pdf2zh/config.v3.toml

    ~/.config/pdf2zh/default/2.0.0.rc0.toml 中会存放当前版本的默认配置,可以参考。

    https://github.com/awwaawwa/PDFMathTranslate/actions/runs/15134272617
    https://github.com/awwaawwa/PDFMathTranslate/pkgs/container/pdfmathtranslate

  14. sufeng commented on May 22, 2025

    @sufeng

    请问2.0版本目是否支持和计划支持:1、PDF是图片扫描件形式的 2、一行中文 一行英文的排版形式

  15. awwaawwa commented on May 22, 2025

    @awwaawwa
    CollaboratorAuthor

    请问2.0版本目是否支持和计划支持:1、PDF是图片扫描件形式的 2、一行中文 一行英文的排版形式

    1. 请自行完成ocr操作。若文件已做过ocr处理,就有初步支持
    2. 不支持且不计划支持
  16. sixpoints commented on May 23, 2025

    @sixpoints

    试用了下5.20号的预览版,发现qwmt模块没匹配"zh-CN": "Chinese",导致无法翻译,提示

    "D:\Programs\pdf2zh_beta\site-packages\pdf2zh\translator\translator_im pl\qwenmt.py", line 58, in lang_mapping return langdict[input_lang] ~~~~~~~~^^^^^^^^^^^^ KeyError: 'zh-CN'

    添加后qwen-mt-plus跑的挺正常,qwen-mt-turbo的话不知道为啥全是提示词

    您是一个专业可靠的机器翻译引擎,负责将输入文本翻译成 zh‑CN。在翻译时,请参 考以下信息以提高翻译质量:0. 全文中的第一个标题:1 | 介绍 1. 全文中最相似的标 题:摘要在翻译时,请遵循以下规则:1. 不要翻译样式标签,例如 "<style id='1'>xxx"!2. 不要翻译公式占位符,例如 "{v3}"。系统会自动用相应的公式替换占 位符。3. 如果不需要翻译(例如专有名词、代码等),则返回原文。4. 只输出翻译结 果,不解释和注释。5. 将文本翻译成 zh‑CN。现在,请仔细阅读以下待翻译文本,并 直接输出翻译结果。

  17. awwaawwa commented on May 24, 2025

    @awwaawwa
    CollaboratorAuthor

    试用了下5.20号的预览版,发现qwmt模块没匹配"zh-CN": "Chinese",导致无法翻译,提示

    "D:\Programs\pdf2zh_beta\site-packages\pdf2zh\translator\translator_im pl\qwenmt.py", line 58, in lang_mapping return langdict[input_lang] ~~~~~~~~^^^^^^^^^^^^ KeyError: 'zh-CN'

    添加后qwen-mt-plus跑的挺正常,qwen-mt-turbo的话不知道为啥全是提示词

    您是一个专业可靠的机器翻译引擎,负责将输入文本翻译成 zh‑CN。在翻译时,请参 考以下信息以提高翻译质量:0. 全文中的第一个标题:1 | 介绍 1. 全文中最相似的标 题:摘要在翻译时,请遵循以下规则:1. 不要翻译样式标签,例如 "<style id='1'>xxx"!2. 不要翻译公式占位符,例如 "{v3}"。系统会自动用相应的公式替换占 位符。3. 如果不需要翻译(例如专有名词、代码等),则返回原文。4. 只输出翻译结 果,不解释和注释。5. 将文本翻译成 zh‑CN。现在,请仔细阅读以下待翻译文本,并 直接输出翻译结果。

    #951

    蹲社区好心人帮忙

  18. awwaawwa commented on May 26, 2025

    @awwaawwa
    CollaboratorAuthor
  19. awwaawwa commented on May 28, 2025

    @awwaawwa
    CollaboratorAuthor

    https://github.com/awwaawwa/PDFMathTranslate/actions/runs/15294364940
    https://github.com/awwaawwa/PDFMathTranslate/pkgs/container/pdfmathtranslate

    sync BabelDOC 0.3.53

    Optimize prompt words to reduce the error rate of rich text translation

    Optimize translation error logs

    sync BabelDOC 0.3.54

    https://github.com/awwaawwa/PDFMathTranslate/actions/runs/15295271576

    Fix a minor layout bug

  20. awwaawwa commented on May 30, 2025

    @awwaawwa
    CollaboratorAuthor

    https://github.com/awwaawwa/PDFMathTranslate/actions/runs/15344872982
    https://github.com/awwaawwa/PDFMathTranslate/pkgs/container/pdfmathtranslate
    Sync BabelDOC 0.3.55

    Added automatic terminology extraction (enabled by default, current version of pdf2zh does not support disabling)


    https://github.com/awwaawwa/PDFMathTranslate/actions/runs/15351474074
    https://github.com/awwaawwa/PDFMathTranslate/pkgs/container/pdfmathtranslate

    Sync BabelDOC 0.3.56

    integrate hyperscan for efficient term matching and improve regex handling

    Significantly improve terminology matching performance

  21. awwaawwa commented on Jun 3, 2025

    @awwaawwa
    CollaboratorAuthor

    https://github.com/awwaawwa/PDFMathTranslate/actions/runs/15344872982 https://github.com/awwaawwa/PDFMathTranslate/pkgs/container/pdfmathtranslate Sync BabelDOC 0.3.55
    Added automatic terminology extraction (enabled by default, current version of pdf2zh does not support disabling)
    https://github.com/awwaawwa/PDFMathTranslate/actions/runs/15351474074 https://github.com/awwaawwa/PDFMathTranslate/pkgs/container/pdfmathtranslate
    Sync BabelDOC 0.3.56
    integrate hyperscan for efficient term matching and improve regex handling
    Significantly improve terminology matching performance

    @awwaawwa Hello, I notice that the current version in the repo is not entire matching that in the docker image, especailly gui.py. My question is that are you going to update in docker image instead of repo-wise update?

    #965
    You can also take note that there is a PR here.

  22. awwaawwa commented on Jun 4, 2025

    @awwaawwa
    CollaboratorAuthor

    2.0 Moved to a new repository under the organization: https://github.com/PDFMathTranslate/PDFMathTranslate-next

    Version 2.0 official release has been published.

  23. changed the title [-]pdf2zh 2.0 预览版 / pdf2zh 2.0 Preview[/-] [+]pdf2zh 2.0[/+] on Jun 4, 2025
  24. zstar1003 commented on Jul 12, 2025

    @zstar1003

    Thank you for this excellent work. I've rewritten a GUI that supports bilingual preview and large model Q&A, which might be of some help.
    https://github.com/zstar1003/FreePDF

  25. reycn commented on Mar 22, 2026

    @reycn
    Collaborator

    Added in a0a313b as an experimental support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions