Skip to content

Fix Chinese translation workflow#3

Merged
B67687 merged 4 commits intomainfrom
translations/fix-chinese-workflow
Apr 9, 2026
Merged

Fix Chinese translation workflow#3
B67687 merged 4 commits intomainfrom
translations/fix-chinese-workflow

Conversation

@B67687
Copy link
Copy Markdown
Owner

@B67687 B67687 commented Apr 9, 2026

What changed

This PR fixes the failing Chinese translation workflow and hardens the translation script so the workflow can run reliably.

Root cause

The current workflow calls python translate-notebooks.py, but the repository file is named translate_notebooks.py. The latest failure on April 9, 2026 stopped immediately with:

python: can't open file '/home/runner/work/MathLearningNotes/MathLearningNotes/translate-notebooks.py': [Errno 2] No such file or directory

Additional fixes included

  • Update the workflow to use current GitHub Actions versions.
  • Run on pull_request for validation, but only push translated notebook updates on non-PR runs.
  • Skip recursive bot-triggered reruns.
  • Commit translated output only when translated-notebooks actually changed.
  • Replace the placeholder Qwen endpoint logic with a real OpenAI-compatible DashScope request path, with env overrides for endpoint and model.
  • Stop the job loudly if the translation API fails, instead of silently writing untranslated copies.
  • Skip translating notebooks inside translated-notebooks to avoid recursive retranslation.

Validation

  • I inspected the latest failed Actions run 24190258737 and confirmed the filename mismatch from the job log.
  • I syntax-checked translate_notebooks.py locally.
  • I did not run a live translation request locally because that would depend on repository secrets and external API access.

@B67687 B67687 marked this pull request as ready for review April 9, 2026 13:04
@B67687 B67687 merged commit c42b47d into main Apr 9, 2026
3 checks passed
@B67687 B67687 deleted the translations/fix-chinese-workflow branch April 9, 2026 13:05
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.

1 participant