Rewrite translation scripts with cleaner architecture#816
Merged
ewels merged 11 commits intonextflow-io:masterfrom Feb 3, 2026
Merged
Rewrite translation scripts with cleaner architecture#816ewels merged 11 commits intonextflow-io:masterfrom
ewels merged 11 commits intonextflow-io:masterfrom
Conversation
- Merge translate.yml and translate-auto.yml into unified Translate workflow - Add 'auto' command (default) that detects outdated translations and prompt changes - Separate tracking for languages needing update vs fix-translations - Create single PR for all language changes instead of per-language PRs - Add missing update-and-add command to translate.py - Fix uv run to use script directly (not via python) for PEP 723 inline deps
Remove matrix build in favor of sequential builds in one job. Also fixes checkout conflict with artifacts directory.
This reverts commit 816bbac.
Move artifacts and combined directories to /tmp before checking out gh-pages branch to avoid conflicts with untracked files.
Add new commands to translate.py: - detect-work: detects languages needing translation updates - run-batch: dispatches translation commands for multiple languages - run-post-fix: runs post-processing fixer Extract helper functions: - get_all_languages(): returns all translation language codes - get_outdated_files(): checks for outdated translations (reused) This reduces the workflow bash from ~200 lines to ~25 lines, making the logic testable and easier to maintain.
- Consolidate translate.py with cleaner structure and simpler commands - Merge doc_parsing_utils.py into translation_fixer.py (self-contained) - Simplify GitHub Actions workflow - Update documentation with new CLI commands Commands changed: - translate-page -> translate - add-missing/update-outdated -> sync - list-removable -> list-orphaned - fix-translations -> post-process
✅ Deploy Preview for nextflow-training ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
Nextflow linting complete! ❌ 1 files had 1 errors 💡 Tip: Click filename locations to go directly to that code. View all 1 issues
View formatting changes
|
- Remove list-missing, list-outdated, list-orphaned commands - Add --dry-run flag to sync command - Always remove orphaned files during sync - Simplify CI workflow and detection logic
- Remove post-process command (runs automatically after translation) - Fix json in comment langs (JSON has no comments) - Extract _extract_comment() helper to eliminate duplication - Cache git repo, create console per-command (not global) - Simplify iter_en_docs(), build_translation_prompt() - Rename regex patterns for consistency (*_RE suffix)
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
Complete rewrite of the translation scripts for cleaner, more maintainable code.
Changes
Files:
_scripts/translate.py: Rewritten with cleaner architecture: Deleted (merged into_scripts/translation_fixer.pytranslate.py): Deleted (merged into_scripts/doc_parsing_utils.pytranslate.py).github/workflows/translate.yml: SimplifiedTRANSLATING.md,CONTRIBUTING.md: Updated documentationCLI (before → after):
translate-page -l <lang> -p <path>translate <path> --lang <lang>add-missingupdate-outdatedfix-translationspost-processsync <lang>list-missinglist-outdatedlist-orphanedsync <lang> --dry-runKey improvements:
translate,sync)