Skip to content

docs: distinguish create-vs-apply customizations for variants in language table#403

Open
shirgoldbird wants to merge 2 commits into
mainfrom
docs/variant-customization-badges
Open

docs: distinguish create-vs-apply customizations for variants in language table#403
shirgoldbird wants to merge 2 commits into
mainfrom
docs/variant-customization-badges

Conversation

@shirgoldbird

Copy link
Copy Markdown
Member

Note

Stacked on #395 (base branch is docs/language-table-from-v3). Once #395 lands, the base flips to main and the diff will show just the FeatureBadges change.

What

Carries forward the one still-useful piece of the now-closed #327 into the generated-table world of #395.

Glossaries and style rules are created for a root language (e.g. EN) but apply when translating into its variants (e.g. EN-GB) — you can't create them for a variant code. The current table shows a flat green Glossaries badge on variant rows, which reads as "you can create a glossary for EN-GB."

This PR renders glossary/style-rule support on variant rows as an orange "Translation: Glossaries" / "Translation: Style Rules" badge with an explanatory tooltip, matching the existing "Translation: Target Only" convention #395 already uses for variants. Root-language rows are unchanged (green Glossaries / Style Rules).

Why this instead of reopening #327

#327 hand-edited the static languageData array (adding translateGlossaries/translateStyleRules flags). #395 makes that array generated from GET /v3/languages with a daily sync workflow, so those edits would be overwritten. This change lives entirely in the FeatureBadges component, outside the BEGIN/END GENERATED markers, so the generator never touches it.

The create-vs-apply concept is also now documented in How to Apply Customizations to Language Variants; this just makes the table consistent with it.

Open question for @lilkraftwerk

The generated data currently has all variants at glossaries: true but styleRules: false (each /v3/languages resource list taken literally). The customize guide says root style rules apply to variant targets too (using-style-rules.mdx: "a list with language: \"en\" works for EN-US and EN-GB targets alike"). So today only the Glossaries apply-via-root badge actually renders on variants; the Style Rules branch is symmetric and correct but inert until the generator marks style-rule support on variants. Worth deciding whether the generator should reflect that — separate from this rendering change.

Test plan

  • mint dev — variant rows (e.g. EN-GB, PT-BR) show an orange "Translation: Glossaries" badge with tooltip; root rows (e.g. EN, DE) still show green "Glossaries"/"Style Rules"
  • Re-run node scripts/generate-language-table.mjs <key> and confirm it only rewrites the languageData array, leaving FeatureBadges intact

🤖 Generated with Claude Code

Lucas Mathis and others added 2 commits July 14, 2026 08:39
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.
…able

Glossaries and style rules are created for a root language (e.g. EN) but
apply when translating into its variants (e.g. EN-GB); you can't create
them for a variant code. On variant rows, render glossary/style-rule
support as a "Translation: ..." badge (matching the existing
"Translation: Target Only" convention) with a tooltip, instead of the
plain green badge that implies the customization can be created for the
variant.

The change lives entirely in the FeatureBadges component, outside the
BEGIN/END GENERATED markers, so the /v3/languages generator and daily
sync workflow won't overwrite it.

Carries forward the intent of the closed PR #327 into the generated-table
world introduced by #395.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@shirgoldbird

Copy link
Copy Markdown
Member Author

cc @BriannaDelgado @lilkraftwerk

Context on how this PR came together:

Base automatically changed from docs/language-table-from-v3 to main July 20, 2026 14:09
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