feat: Add automated translation sync workflow with DeepSeek API#876
Merged
comfyui-wiki merged 5 commits intomainfrom Apr 1, 2026
Merged
feat: Add automated translation sync workflow with DeepSeek API#876comfyui-wiki merged 5 commits intomainfrom
comfyui-wiki merged 5 commits intomainfrom
Conversation
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
- .github/workflows/translation-sync.yml: triggers on push to main, detects which language files are out of sync, runs translation script, creates a PR for review - .github/scripts/translate-sync.py: diff-based translation — only translates changed sections (split by headings), skips files already updated in the same commit - .github/scripts/translation-config.json: language config, easily extensible to add new languages Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…fixes - Use section index position instead of heading text to match sections between English and translated files (language-agnostic) - Fix language dir: zh-CN → zh, snippets/zh - Fix workflow: use step output for branch name instead of env var - Fix workflow: use gh pr create body inline to avoid heredoc issues - Add .env to .gitignore Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace content-based index matching with proper unified diff hunk header parsing (@@ -a,b +c,d @@). Changed line ranges in the new file are mapped to section indices via line number overlap, making the logic fully language-agnostic and correctly handling inserted, deleted, or reordered sections. Also add .env to .gitignore. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Per-section error isolation with [FALLBACK] logging - API retry with exponential backoff (3 attempts) - MDX tag count validation post-translation - Frontmatter integrity check (--- delimiters) - File-level error isolation - Empty API response guard - Fallback to full-file translation when diff yields no changed sections - Add zh-CN to exclude_dirs in translation config Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
190cb35 to
327751f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.github/workflows/translation-sync.yml— triggers when a PR with theneeds-translationlabel is merged into main, or via manualworkflow_dispatch.github/scripts/translate-sync.py— diff-based translation sync using DeepSeek API.github/scripts/translation-config.json— language config (Japanese, Simplified Chinese)How it works
needs-translation-labeled PR, the workflow detects changed English.mdxfilesRobustness features
To add a new language
Add an entry to `.github/scripts/translation-config.json`.
Test plan
🤖 Generated with Claude Code