Generate supported-languages table from /v3/languages#395
Open
lilkraftwerk wants to merge 1 commit into
Open
Conversation
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
cf43af6 to
f63866c
Compare
f63866c to
54d4f6a
Compare
7e6bb43 to
afe4c57
Compare
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.
afe4c57 to
7dd2921
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.
Note
Based on #396 and merges after it; the base branch will flip back to
mainautomatically 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:
generate-language-table.mjsgenerate-voice-languages.mjsgenerate-write-lists.mjstarget_lang/writing_style/tonelists on improve-textgenerate-style-rules-lists.mjsGenerated content sits between
BEGIN/END GENERATEDmarkers; everything outside stays hand-written. Each script also runs standalone. The API key is passed as an argument, never stored. SetDEEPL_SERVER_URLto 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)
/v3/languages)DE-DE/FR-FRvariants,DE-CH/FR-CAcorrected,EN/ZH/PT-PTgain text improvementen/ptandzh-Hantper the API;writing_style/tonelists gain baseptNorwegian (bokmål)naming, alphabetical order); the service-specification lists gain the beta languageshi,ms,taand baseen/zhas text targetsRegenerating after future API changes is one command and a reviewable diff.