Add automated translation stub generation for missing content - #1473
Add automated translation stub generation for missing content#1473aashishpanthi wants to merge 25 commits into
Conversation
…in a nice expandable way
…README documentation
…generation limits per language; remove test files.
Divyansh013
left a comment
There was a problem hiding this comment.
Hi @aashishpanthi , have added some comments
… only see the logs or also generate the real PRs
Divyansh013
left a comment
There was a problem hiding this comment.
left minor comments, overall looks clean
|
Thank you for your review. I've fixed the issues and pushed the code. Thank you! |
|
Hi @Divyansh013, as discussed in our last call, I checked if the website is breaking when the stub files are merged, it turns out it does break. I found two issues:1. MDX compilation error with HTML commentsThe stub generator uses HTML-style comments Fix: Changed stub comments to JSX-style 2. Stub files bypass English fallback, rendering empty content (proposed fix)The locale fallback logic in Additionally, Proposed fix: Add About the second issue, I want to work on the fix and push it here, if that sounds good. Waiting for your approval. |
Addresses #1404
Changes
This PR implements stub-file generation for the GSoC 2026 Translation Tracker (#1404). When a new English content files (except references) exists without translations, the tracker generates placeholder MDX stubs and opens one PR per language for maintainer review.
Features
Stub generation
findMissingTranslations)title,module,submodule,file,description)needsTranslation: truees,hi,ko,zh-HansSTUB_MAX_FILESapplies per language (default50), not as a global cap across all languagesGitHub Actions
.github/workflows/translation-stubs.ymlGENERATE_STUBS=true), separate from issue tracking intranslation-sync.ymlsrc/content/**/en/**changes (exceptsrc/content/references/en/**for now)workflow_dispatchwithfull_scanandlanguagesinputsLocal testing
npm run test:stubs— dry-run stub generation intostub-preview/(no PRs, nosrc/content/changes)Code organization
After discussing with Divyansh, I refactored the translation tracker from a single large
index.jsinto focused modules:index.jsconstants.jsutils.jsgithub-tracker.jsworkflows.jsDesign decisions
GENERATE_STUBS=truereturns before issue logic), so PR and issue workflows stay independent.examples,tutorials, etc. have been added viaSTUB_CONTENT_TYPES.Test plan
aap009/p5.js-website): workflow creates stub PRs when English content files are addedPR Checklist
To:Do
main. I added feature branch for testing.