feat(snippets): regenerate language-table.jsx from vended data#349
Draft
daniel-jones-dev wants to merge 1 commit into
Draft
feat(snippets): regenerate language-table.jsx from vended data#349daniel-jones-dev wants to merge 1 commit into
daniel-jones-dev wants to merge 1 commit into
Conversation
1c71aae to
f8ab188
Compare
360a229 to
35772a9
Compare
Introduces scripts/generate_language_table.py, which reads the JSON files vended under data/v3-languages/ plus a manual data/translation-memory.json (TM is not exposed via the API) and rewrites the languageData array in snippets/language-table.jsx between new BEGIN/END GENERATED markers. The surrounding JSX (filters, sorting, table rendering) is unchanged. Also wires the generator into the hourly refresh workflow so future upstream changes flow straight to the rendered language table in the same PR. The first run picks up several genuine API changes that the manual data had drifted from (e.g. tag_handling support added to many languages, new de-DE / fr-FR generic variants, current beta status of de-CH / fr-CA). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
35772a9 to
585ea52
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
scripts/generate_language_table.pyreadsdata/v3-languages/*.json+data/translation-memory.jsonand rewrites thelanguageDataarray insnippets/language-table.jsxbetween// BEGIN GENERATED/// END GENERATEDmarkers. Surrounding JSX is untouched.data/translation-memory.jsonholds the small list of TM-supported codes — TM is not exposed via/v3/languages, so it stays manual.tag_handlingenabled on many languages it was previously marked false for, genericde-DE/fr-FRvariants now listed,de-CH/fr-CAcorrectly flagged as beta.Stacked on #348 — base is
refresh-v3-languages-action. Retarget after both upstream PRs merge.Source-of-truth mapping
codelangfromtranslate_text.json, uppercasednamenamefromtranslate_text.jsontranslationtrue(only languages present intranslate_text.jsonare emitted)isVarianttranslate_textusable_as_source=false && usable_as_target=trueisBetatranslate_textstatus != "stable"glossariestranslate_textfeatures containglossarytagHandlingtranslate_textfeatures containtag_handlingtextImprovementwrite.jsonstyleRulestranslate_textfeatures containstyle_rulestranslationMemorydata/translation-memory.jsonTest plan
python3 scripts/generate_language_table.py --checkexits 0 (no diff).data/translation-memory.json, re-run generator without--check, confirm only the affected rows change insnippets/language-table.jsx.mint devrenders/docs/getting-started/supported-languagesand the table includes the newDE-DE/FR-FRentries.data/v3-languages/**andsnippets/language-table.jsx.🤖 Generated with Claude Code