From b64f9722f393eb66dce5f298c535b80c58600026 Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Wed, 14 Oct 2026 17:26:04 -0700 Subject: [PATCH] refactor(website): render reason and launch-hero headings as complete messages ReasonSection, ReasonsSplit01 and ModelLaunchHeroSection built their headings from a lead fragment plus a styled highlight (or a muted rest), so every locale had to break the sentence where English did. Each heading is now one message with a named placeholder ({highlight} or {model}) rendered through I18nT slots. ReasonsSplit01 takes the heading as a slot so the block stays free of i18n; its three WhySection callers render the I18nT. The unused headingSuffixKey prop is gone. Model-launch heroes swap titleRestKey for titleModelKey, with titleKey pointing at the complete headline. New keys (headline) carry the zh-CN and ja copy joined from the old fragments, so generation keeps it. --- apps/website/e2e/gemini-omni.spec.ts | 6 +- apps/website/e2e/minimax-h3.spec.ts | 8 +- .../blocks/ReasonsSplit01.stories.ts | 27 +++++-- .../src/components/blocks/ReasonsSplit01.vue | 12 +-- .../components/interpolatedHeadings.test.ts | 75 +++++++++++++++++++ .../product/cloud/ReasonSection.vue | 2 +- .../product/local/ReasonSection.vue | 2 +- .../product/shared/ReasonSection.stories.ts | 2 +- .../product/shared/ReasonSection.vue | 23 +++--- apps/website/src/data/fishAudio.ts | 4 +- apps/website/src/data/flux3.ts | 4 +- apps/website/src/data/geminiOmni.ts | 4 +- apps/website/src/data/minimax.ts | 4 +- apps/website/src/data/minimaxMusic3.ts | 4 +- apps/website/src/locales/en/main.json | 20 ++--- apps/website/src/locales/ja/main.json | 34 ++++----- apps/website/src/locales/zh-CN/main.json | 34 ++++----- apps/website/src/templates/cli/WhySection.vue | 18 +++-- .../src/templates/cloud-nodes/WhySection.vue | 18 ++++- .../src/templates/cloud-nodes/copy.test.ts | 2 +- apps/website/src/templates/mcp/WhySection.vue | 19 +++-- .../ModelLaunchHeroSection.test.ts | 40 ++++++++++ .../model-launch/ModelLaunchHeroSection.vue | 71 ++++++++++++------ .../model-launch/modelLaunchPages.test.ts | 2 +- .../src/templates/model-launch/types.ts | 3 +- 25 files changed, 303 insertions(+), 135 deletions(-) diff --git a/apps/website/e2e/gemini-omni.spec.ts b/apps/website/e2e/gemini-omni.spec.ts index e01bb50d27f..09e991eac00 100644 --- a/apps/website/e2e/gemini-omni.spec.ts +++ b/apps/website/e2e/gemini-omni.spec.ts @@ -10,7 +10,11 @@ import { test } from './fixtures/blockExternalMedia' const PATH = '/gemini-omni' const ZH_PATH = '/zh-CN/gemini-omni' -const HERO_TITLE = `${t('geminiOmni.hero.titleModel', {}, { locale: 'en' })}${t('geminiOmni.hero.titleRest', {}, { locale: 'en' })}` +const HERO_TITLE = t( + 'geminiOmni.hero.headline', + { model: t('geminiOmni.hero.titleModel', {}, { locale: 'en' }) }, + { locale: 'en' } +) const MODELS_HEADING = t('geminiOmni.models.heading', {}, { locale: 'en' }) const STEPS_HEADING = t('geminiOmni.steps.heading', {}, { locale: 'en' }) const STEPS_CTA = t('geminiOmni.steps.secondaryCta', {}, { locale: 'en' }) diff --git a/apps/website/e2e/minimax-h3.spec.ts b/apps/website/e2e/minimax-h3.spec.ts index 725e60b03fc..7c00f862b72 100644 --- a/apps/website/e2e/minimax-h3.spec.ts +++ b/apps/website/e2e/minimax-h3.spec.ts @@ -9,9 +9,11 @@ import { test } from './fixtures/blockExternalMedia' import { waitForIsland } from './fixtures/islands' const PATH = '/minimax-h3' -const HERO_TITLE = - t('minimax.hero.titleModel', {}, { locale: 'en' }) + - t('minimax.hero.titleRest', {}, { locale: 'en' }) +const HERO_TITLE = t( + 'minimax.hero.headline', + { model: t('minimax.hero.titleModel', {}, { locale: 'en' }) }, + { locale: 'en' } +) const MODELS_HEADING = t('minimax.models.heading', {}, { locale: 'en' }) const MODELS_ROUTE = getRoutes('en').workshop const CTA_HEADING = t('minimax.cta.heading', {}, { locale: 'en' }) diff --git a/apps/website/src/components/blocks/ReasonsSplit01.stories.ts b/apps/website/src/components/blocks/ReasonsSplit01.stories.ts index 5c8d499aa97..88e283e71ba 100644 --- a/apps/website/src/components/blocks/ReasonsSplit01.stories.ts +++ b/apps/website/src/components/blocks/ReasonsSplit01.stories.ts @@ -11,10 +11,18 @@ const meta: Meta = { template: '
' }) ], + render: (args) => ({ + components: { ReasonsSplit01 }, + setup: () => ({ args }), + template: ` + + + + ` + }), args: { - heading: 'Why teams choose ', - headingHighlight: 'ComfyUI', - highlightClass: 'text-primary-comfy-yellow', subtitle: 'A flexible foundation for production-grade visual AI.', reasons: [ { @@ -45,8 +53,13 @@ type Story = StoryObj export const Default: Story = {} export const WithoutHighlight: Story = { - args: { - heading: 'Why teams choose ComfyUI', - headingHighlight: undefined - } + render: (args) => ({ + components: { ReasonsSplit01 }, + setup: () => ({ args }), + template: ` + + + + ` + }) } diff --git a/apps/website/src/components/blocks/ReasonsSplit01.vue b/apps/website/src/components/blocks/ReasonsSplit01.vue index 48b9df0f105..86a4982d4f4 100644 --- a/apps/website/src/components/blocks/ReasonsSplit01.vue +++ b/apps/website/src/components/blocks/ReasonsSplit01.vue @@ -5,10 +5,7 @@ export interface Reason { description: string } -const { highlightClass = 'text-white' } = defineProps<{ - heading: string - headingHighlight?: string - highlightClass?: string +defineProps<{ subtitle?: string reasons: readonly Reason[] }>() @@ -18,24 +15,19 @@ const { highlightClass = 'text-white' } = defineProps<{
-

- {{ heading - }}{{ - headingHighlight - }} +

{{ subtitle }}

-
diff --git a/apps/website/src/components/product/local/ReasonSection.vue b/apps/website/src/components/product/local/ReasonSection.vue index 5429e808b53..d359e0e5de2 100644 --- a/apps/website/src/components/product/local/ReasonSection.vue +++ b/apps/website/src/components/product/local/ReasonSection.vue @@ -30,7 +30,7 @@ const reasons: Reason[] = [