Skip to content

Fix raw translation keys leaking after useTranslations migration#18823

Merged
pettinarip merged 2 commits into
stagingfrom
fix/tutorial-skill-tag-translation-key
Jul 16, 2026
Merged

Fix raw translation keys leaking after useTranslations migration#18823
pettinarip merged 2 commits into
stagingfrom
fix/tutorial-skill-tag-translation-key

Conversation

@pettinarip

Copy link
Copy Markdown
Member

Description

Fixes the Chromatic page-visual-test regression on tutorial pages caught on the v11.15.0 deploy PR (#18820): the skill tag rendered the raw key PAGE-DEVELOPERS-TUTORIALS:PAGE-TUTORIAL-BEGINNER instead of "Beginner", breaking the tag row layout.

Root cause: 780bc22 migrated TutorialMetadata to next-intl's namespace-bound useTranslations, but getSkillTranslationId still returned the legacy namespace:key form, which next-intl cannot resolve.

Changes:

  • getSkillTranslationId returns the bare key (page-tutorial-*); the tutorials listing uses its namespace-bound t() instead of the legacy <Translation> id form.
  • Same bug class in app/[locale]/quizzes/page-jsonld.tsx: t("common:quizzes-title") on a page-quizzes-bound translator leaked the raw key into the JSON-LD WebPage/breadcrumb names. Now uses a common-bound translator.

A codebase-wide sweep found no other namespace:key strings passed to bound next-intl translators.

Verified locally: type-check + lint pass; tutorial page renders the BEGINNER tag with baseline layout, tutorials listing pills correct, quizzes JSON-LD emits "Quiz Hub".

Targets staging to unblock the v11.15.0 release.

getSkillTranslationId still returned the legacy "namespace:key" form
after the useTranslations migration (780bc22), so the namespace-bound
t() in TutorialMetadata rendered the literal key. Return the bare key
and use the bound t() in the tutorials listing as well.
Same class of bug as the tutorial skill tag: t bound to page-quizzes
was passed the legacy "common:quizzes-title" id, so the WebPage and
breadcrumb names in the structured data rendered the raw key. Bind a
second translator for the common namespace.
@pettinarip
pettinarip requested a review from wackerow as a code owner July 16, 2026 16:54
@netlify

netlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit fc99718
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/6a590cd4d1aa5200087349b2
😎 Deploy Preview https://deploy-preview-18823.ethereum.it
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 60 (🟢 up 4 from production)
Accessibility: 95 (no change from production)
Best Practices: 100 (no change from production)
SEO: 98 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown
Contributor

🔎 First-pass review — ✅ Looks mergeable

Tight, correct fix for the raw-key leak introduced when TutorialMetadata moved to next-intl namespace-bound useTranslations. getSkillTranslationId now returns the bare key and both call sites (TutorialMetadata.tsx, tutorials.tsx) resolve it through their page-developers-tutorials-bound t() — verified the page-tutorial-{beginner,intermediate,advanced} keys exist in that namespace. The quizzes JSON-LD fix is the same bug class: quizzes-title lives in common, so the new common-bound tCommon() is the right binding. Targeting staging to unblock v11.15.0 is appropriate.

Analysis

Lane: code (3 files: TutorialMetadata.tsx, tutorials.tsx, quizzes/page-jsonld.tsx).

Checked:

  • Both getSkillTranslationId callers bind t to page-developers-tutorials; returned keys resolve there → "Beginner"/"Intermediate"/"Advanced". ✅
  • quizzes-title present in common.json ("Quiz Hub"); tCommon binding correct. ✅
  • No remaining namespace:key usages of the helper (grep confirms only the two call sites). ✅
  • Translation import still used elsewhere in both touched files — no unused import. ✅
  • TranslationKey = string, so the bare-key return type is satisfied.

CI still running on a fresh PR — nothing to flag there. No blocking or non-blocking issues found.

Generated by PR Reviewer (team) for #18823 · 73.2 AIC · ⌖ 10.3 AIC · ⊞ 5.2K ·

@github-actions

Copy link
Copy Markdown
Contributor
Page Performance Accessibility Best practices SEO PWA

Lighthouse scores are calculated based on the latest audit results

@pettinarip
pettinarip merged commit 280d430 into staging Jul 16, 2026
24 of 25 checks passed
@pettinarip
pettinarip deleted the fix/tutorial-skill-tag-translation-key branch July 16, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants