Skip to content

feat(snippets): regenerate language-table.jsx from vended data#349

Draft
daniel-jones-dev wants to merge 1 commit into
refresh-v3-languages-actionfrom
autogen-language-tables
Draft

feat(snippets): regenerate language-table.jsx from vended data#349
daniel-jones-dev wants to merge 1 commit into
refresh-v3-languages-actionfrom
autogen-language-tables

Conversation

@daniel-jones-dev
Copy link
Copy Markdown
Member

Summary

  • New scripts/generate_language_table.py reads data/v3-languages/*.json + data/translation-memory.json and rewrites the languageData array in snippets/language-table.jsx between // BEGIN GENERATED / // END GENERATED markers. Surrounding JSX is untouched.
  • data/translation-memory.json holds the small list of TM-supported codes — TM is not exposed via /v3/languages, so it stays manual.
  • Hourly workflow (added in chore(ci): refresh vended v3/languages responses hourly #348) now runs the generator after fetching, so refreshed responses and the rendered table land in the same PR.
  • First-run regeneration brings the table back in sync with the live API: e.g. tag_handling enabled on many languages it was previously marked false for, generic de-DE / fr-FR variants now listed, de-CH / fr-CA correctly flagged as beta.

Stacked on #348 — base is refresh-v3-languages-action. Retarget after both upstream PRs merge.

Source-of-truth mapping

JSX field Source
code lang from translate_text.json, uppercased
name name from translate_text.json
translation always true (only languages present in translate_text.json are emitted)
isVariant translate_text usable_as_source=false && usable_as_target=true
isBeta translate_text status != "stable"
glossaries translate_text features contain glossary
tagHandling translate_text features contain tag_handling
textImprovement language is in write.json
styleRules translate_text features contain style_rules
translationMemory code is in data/translation-memory.json

Test plan

  • python3 scripts/generate_language_table.py --check exits 0 (no diff).
  • Edit data/translation-memory.json, re-run generator without --check, confirm only the affected rows change in snippets/language-table.jsx.
  • mint dev renders /docs/getting-started/supported-languages and the table includes the new DE-DE / FR-FR entries.
  • Manually dispatch the refresh workflow (after chore(ci): refresh vended v3/languages responses hourly #348 merges) and confirm the auto-PR includes both data/v3-languages/** and snippets/language-table.jsx.

🤖 Generated with Claude Code

@daniel-jones-dev daniel-jones-dev marked this pull request as draft May 19, 2026 12:26
@daniel-jones-dev daniel-jones-dev force-pushed the refresh-v3-languages-action branch from 1c71aae to f8ab188 Compare May 19, 2026 12:31
@daniel-jones-dev daniel-jones-dev force-pushed the autogen-language-tables branch from 360a229 to 35772a9 Compare May 19, 2026 12:31
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>
@daniel-jones-dev daniel-jones-dev force-pushed the autogen-language-tables branch from 35772a9 to 585ea52 Compare May 19, 2026 13:01
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