Skip to content

fix(website): translate hero tagline on the landing#166

Merged
montfort merged 1 commit into
mainfrom
fix/website-hero-tagline-i18n
May 18, 2026
Merged

fix(website): translate hero tagline on the landing#166
montfort merged 1 commit into
mainfrom
fix/website-hero-tagline-i18n

Conversation

@montfort
Copy link
Copy Markdown
Contributor

Summary

PR3 left the home H1 rendered via {siteConfig.tagline} from docusaurus.config.ts, bypassing the i18n pipeline. The Spanish landing at /es/ displayed the English headline even though pillars / CTAs / captions / features / why-paragraph were all wrapped in <Translate> correctly.

Fix

  • src/components/Hero/index.tsx — wrap the H1 in <Translate id="hero.tagline">; drop the now-unused useDocusaurusContext import.
  • src/pages/index.tsx — use the imperative translate({id: 'hero.tagline', ...}) for the Layout description prop so the <meta name="description"> tag also localizes (was previously the English tagline on every locale).
  • i18n/es/code.json — add hero.tagline → "Disciplina cognitiva para la ingeniería asistida por IA".

Test plan

  • npm run build produces build/index.html with English <h1> and build/es/index.html with Spanish <h1>
  • After merge, /es/ shows the Spanish tagline as the H1 and as the meta description

🤖 Generated with Claude Code

The PR3 landing left the H1 tagline rendered via `{siteConfig.tagline}`
directly from docusaurus.config.ts, which bypasses the i18n pipeline.
Result: the Spanish home at /es/ showed the English headline even though
every other string on the page (pillars, CTAs, captions, features, why
paragraph) was already wrapped in <Translate>.

This swaps the tagline for a <Translate id="hero.tagline"> wrapper and
adds the matching key to website/i18n/es/code.json. Layout's `description`
prop (used for <meta name="description">) now uses the same translated
string via the imperative `translate()` helper, so the meta tag also
localizes on /es/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@montfort montfort merged commit 3e3fa91 into main May 18, 2026
1 check passed
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