docs: distinguish create-vs-apply customizations for variants in language table#403
docs: distinguish create-vs-apply customizations for variants in language table#403shirgoldbird wants to merge 1 commit into
Conversation
…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>
|
cc @BriannaDelgado @lilkraftwerk Context on how this PR came together:
|
Note
Stacked on #395 (base branch is
docs/language-table-from-v3). Once #395 lands, the base flips tomainand the diff will show just theFeatureBadgeschange.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 forEN-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
languageDataarray (addingtranslateGlossaries/translateStyleRulesflags). #395 makes that array generated fromGET /v3/languageswith a daily sync workflow, so those edits would be overwritten. This change lives entirely in theFeatureBadgescomponent, outside theBEGIN/END GENERATEDmarkers, 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: truebutstyleRules: false(each/v3/languagesresource list taken literally). The customize guide says root style rules apply to variant targets too (using-style-rules.mdx: "a list withlanguage: \"en\"works forEN-USandEN-GBtargets 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"node scripts/generate-language-table.mjs <key>and confirm it only rewrites thelanguageDataarray, leavingFeatureBadgesintact🤖 Generated with Claude Code