fix(website): translate hero tagline on the landing#166
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR3 left the home H1 rendered via
{siteConfig.tagline}fromdocusaurus.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-unuseduseDocusaurusContextimport.src/pages/index.tsx— use the imperativetranslate({id: 'hero.tagline', ...})for the Layoutdescriptionprop so the<meta name="description">tag also localizes (was previously the English tagline on every locale).i18n/es/code.json— addhero.tagline→ "Disciplina cognitiva para la ingeniería asistida por IA".Test plan
npm run buildproducesbuild/index.htmlwith English<h1>andbuild/es/index.htmlwith Spanish<h1>/es/shows the Spanish tagline as the H1 and as the meta description🤖 Generated with Claude Code