Skip to content

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

Open
shirgoldbird wants to merge 1 commit into
docs/language-table-from-v3from
docs/variant-customization-badges
Open

docs: distinguish create-vs-apply customizations for variants in language table#403
shirgoldbird wants to merge 1 commit into
docs/language-table-from-v3from
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

…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:

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