Skip to content

Generate supported-languages table from /v3/languages#395

Open
lilkraftwerk wants to merge 1 commit into
mainfrom
docs/language-table-from-v3
Open

Generate supported-languages table from /v3/languages#395
lilkraftwerk wants to merge 1 commit into
mainfrom
docs/language-table-from-v3

Conversation

@lilkraftwerk

@lilkraftwerk lilkraftwerk commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Note

Based on #396 and merges after it; the base branch will flip back to main automatically when that PR lands.

What

Language-support info across the docs was hand-maintained and drifting from what the API reports. This PR makes it generated from GET /v3/languages.

One script per target, plus a parent that updates everything:

node scripts/update-language-docs.mjs <api-key>
Script Target
generate-language-table.mjs languages table on Languages supported
generate-voice-languages.mjs Voice API support matrix (docs/voice) + the input/target lists on the service-specification page
generate-write-lists.mjs target_lang / writing_style / tone lists on improve-text
generate-style-rules-lists.mjs style-rules callout on the supported-languages page

Generated content sits between BEGIN/END GENERATED markers; everything outside stays hand-written. Each script also runs standalone. The API key is passed as an argument, never stored. Set DEEPL_SERVER_URL to run against a mock. The OpenAPI spec is untouched.

A daily workflow (sync-language-docs.yml) reruns the generators against the live API and opens/updates a bot PR when anything drifts, so future language launches show up as a reviewable diff without anyone remembering to run the script.

Earlier revisions also generated the formality lists on the translate/document pages and a style-rules mention on translate; those pages became OpenAPI stubs in #396, so that generator was dropped.

Notable data changes (all now match the live API)

  • style rules and translation memory: the table and the supported-languages callout pick up the expanded language support that went live with the June 30 launch (now served by prod /v3/languages)
  • supported-languages table: tag handling shown for all translation languages, new DE-DE/FR-FR variants, DE-CH/FR-CA corrected, EN/ZH/PT-PT gain text improvement
  • improve-text: adds base en/pt and zh-Hant per the API; writing_style/tone lists gain base pt
  • voice: matrix content matches the API (Norwegian (bokmål) naming, alphabetical order); the service-specification lists gain the beta languages hi, ms, ta and base en/zh as text targets

Regenerating after future API changes is one command and a reviewable diff.

@mintlify

mintlify Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
deepl-c950b784 🟢 Ready View Preview Jul 9, 2026, 7:32 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Replace the hand-maintained language lists with generators that render
them from the live GET /v3/languages response: the supported-languages
table (snippets/language-table.jsx), the Voice support matrix and
input/target lists, and the style-rules callout on the
supported-languages page. Generated content sits between BEGIN/END
GENERATED markers; everything outside them stays hand-written.

node scripts/update-language-docs.mjs <api-key> runs every generator;
each script also runs standalone and supports --dry-run. Shared
plumbing lives in scripts/lib.mjs with zero-dependency unit tests
(node --test, wired up in CI via test-scripts.yml).

A daily workflow (sync-language-docs.yml) regenerates the docs and
opens or updates a bot PR whenever the API response changed, surfacing
any generator warnings in the PR body.

The regenerated content also refreshes the data itself: new Voice
languages (Hindi, Malay, Tamil), the style-rules expansion from 8 to
33 target languages, and the full translate_text long tail in the
language table.
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