Skip to content

Conversation

@lingxiaobc
Copy link

@lingxiaobc lingxiaobc commented Feb 10, 2026

PR Title

[PR]

Related Issue(s)

Motivation and Context

Summary of Changes

PR Type

  • ✨ Enhancement
  • πŸ› Bug Fix
  • πŸ“š Documentation
  • πŸ—οΈ Refactor
  • πŸ§ͺ Test
  • 🧹 Chore

Breaking Changes

Contributor Checklist

  • I have fully read and understood the CONTRIBUTING.md guide.
  • I have performed a self-review of my own code.
  • My changes follow the project's code style and guidelines
  • I have linked the related issue(s) in the description above (if applicable)
  • I have updated relevant documentation (if applicable)
  • I have added necessary tests that prove my fix is effective or that my feature works (if applicable)
  • All new and existing tests passed locally with my changes
  • My changes generate no new warnings or errors
  • I understand that due to limited maintainer resources, only small PRs are accepted. Suggestions with proof-of-concept patches are appreciated, and my patch may be rewritten if necessary.

Testing Instructions

Screenshots (if applicable)

Additional Notes


Summary by cubic

Adds a ready-to-run Python script for translating PDFs with BabelDOC and a concise spec to build a simple web app that wraps it with progress and downloads. This makes it easy to test local translation and implement a FastAPI + SSE flow later.

  • New Features
    • translate_pdf.py: Async PDF translation using babeldoc.format.pdf.high_level.async_translate with progress updates, QPS limiter, ONNX DocLayoutModel, and mono/dual PDF outputs (no watermark). Configurable paths, API base URL, key, model, and languages.
    • web_translate_prompt.md: End-to-end spec for a FastAPI + SSE app, including exact BabelDOC API usage, lifespan init, background tasks, 4 endpoints (/, POST /api/translate, GET /api/progress/{task_id}, GET /api/download/{task_id}/{file_type}), task cleanup, front-end layout/flow, and run steps.

Written for commit 45fea80. Summary will update on new commits.

Provides a ready-to-use script with placeholders for API base URL,
API key, model name, and input/output paths.

https://claude.ai/code/session_01WbUZ9kMJy2d3k2ReDzzCvi
Detailed instructions for AI to generate a FastAPI + SSE web app
that wraps BabelDOC's Python API with file upload, real-time
progress tracking, and translated PDF download.

https://claude.ai/code/session_01WbUZ9kMJy2d3k2ReDzzCvi
Restructured into 8 clear sections covering: API call conventions
with exact import paths and code, FastAPI lifespan/SSE/task
management details, frontend layout wireframe, and interaction flow.

https://claude.ai/code/session_01WbUZ9kMJy2d3k2ReDzzCvi
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants