You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The auto-translation GitHub Action (.github/workflows/auto-translation.yaml) has been producing translated files with two recurring defects that require manual cleanup before every merge:
Code-fence wrapping (~30% of files) — the LLM wraps the entire translated file in ```markdown ... ``` or ```yaml ... ```, which breaks Hugo's frontmatter parser.
Duplicate YAML keys — some translated answer-key files contain two hidden: true lines, which the YAML parser rejects.
This is a workflow-level bug, not a content bug. The fix belongs in the translator itself, not in each PR.
Root cause
The translator lives in the translation-tool submodule. Looking at WorkshopAutoTranslation/WorkShopTranslationV2/Program.cs, three things were driving the defects:
The prompt did not explicitly forbid code-fence wrapping or extra frontmatter keys.
Temperature = 1.0 for what is a deterministic task.
The LLM response was written to disk with no post-processing and no validation of any kind.
There's also a path-replace substring bug — filePath.Replace("english", newFolder) would corrupt any future workshop whose name contains the substring "english" (e.g. my-english-club).
A separate PR will be needed here in workshops to:
Bump the translation-tool submodule pointer from 46d1968 to the new HEAD on main.
Bump .github/workflows/auto-translation.yamldotnet-version from 8.0.x to 10.0.x (the tool repo upgraded to .NET 10 in their Page - By tag pages #6 but the workshops side never caught up — this is a latent bug that would have broken the next submodule bump regardless of this fix).
Both changes must ship together.
cc @ozhang22 — flagging you since you're admin on both repos and will probably be the one reviewing the tool PR.
Summary
The auto-translation GitHub Action (
.github/workflows/auto-translation.yaml) has been producing translated files with two recurring defects that require manual cleanup before every merge:```markdown ... ```or```yaml ... ```, which breaks Hugo's frontmatter parser.hidden: truelines, which the YAML parser rejects.Observed in recent bot PRs:
hugobuild broke.This is a workflow-level bug, not a content bug. The fix belongs in the translator itself, not in each PR.
Root cause
The translator lives in the
translation-toolsubmodule. Looking atWorkshopAutoTranslation/WorkShopTranslationV2/Program.cs, three things were driving the defects:Temperature = 1.0for what is a deterministic task.MaxTokens = 1500— several workshop pages exceed this, getting silently truncated mid-translation.There's also a path-replace substring bug —
filePath.Replace("english", newFolder)would corrupt any future workshop whose name contains the substring "english" (e.g.my-english-club).Proposed fix (PR open)
📦 NuevoFoundation/WorkshopsAutoTranslation#7 — Fix recurring AI translation output bugs (fences, dup keys, truncation)
Summary of the change:
Temperature:1.0→0.2;MaxTokens:1500→8192.YamlDotNetwithWithDuplicateKeyChecking()) catches dup keys, key-set mismatches, empty bodies, residual fences, andFinishReason = lengthtruncation.Replace("english", ...)substring bug with a segment-aware path replace.Follow-up after the tool PR merges
A separate PR will be needed here in
workshopsto:translation-toolsubmodule pointer from46d1968to the new HEAD onmain..github/workflows/auto-translation.yamldotnet-versionfrom8.0.xto10.0.x(the tool repo upgraded to .NET 10 in their Page - By tag pages #6 but the workshops side never caught up — this is a latent bug that would have broken the next submodule bump regardless of this fix).Both changes must ship together.
cc @ozhang22 — flagging you since you're admin on both repos and will probably be the one reviewing the tool PR.