Skip to content

fix: correct translation keys for developers learning tools page meta title#15732

Merged
wackerow merged 1 commit into
devfrom
claude/issue-15731-20250627_094636
Jul 15, 2025
Merged

fix: correct translation keys for developers learning tools page meta title#15732
wackerow merged 1 commit into
devfrom
claude/issue-15731-20250627_094636

Conversation

@konopkja
Copy link
Copy Markdown
Contributor

Fix broken page title that was showing "page-developers-learning-tools-meta-title" instead of "Developer learning tools".

The issue was caused by incorrect translation key syntax in the generateMetadata function. The namespace was being double-referenced, causing the translation to fail and display the raw key instead of the translated text.

  • Remove namespace prefix from translation keys since namespace is already set in getTranslations
  • Change "page-developers-learning-tools:page-learning-tools-meta-title" to "page-learning-tools-meta-title"
  • Change "page-developers-learning-tools:page-learning-tools-meta-desc" to "page-learning-tools-meta-desc"

Fixes #15731

Generated with Claude Code

… title

Fix broken page title that was showing "page-developers-learning-tools-meta-title" instead of "Developer learning tools".

The issue was caused by incorrect translation key syntax in the generateMetadata function. The namespace was being double-referenced, causing the translation to fail and display the raw key instead of the translated text.

- Remove namespace prefix from translation keys since namespace is already set in getTranslations
- Change "page-developers-learning-tools:page-learning-tools-meta-title" to "page-learning-tools-meta-title"  
- Change "page-developers-learning-tools:page-learning-tools-meta-desc" to "page-learning-tools-meta-desc"

Fixes #15731

Co-authored-by: Jakub <konopkja@users.noreply.github.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 27, 2025

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 2618712
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/685e6962b4c12b0008dbb716
😎 Deploy Preview https://deploy-preview-15732--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 50 (no change from production)
Accessibility: 96 (🟢 up 1 from production)
Best Practices: 91 (🔴 down 1 from production)
SEO: 99 (no change from production)
PWA: 59 (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.

@konopkja
Copy link
Copy Markdown
Contributor Author

@coderabbitai can you review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 27, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@konopkja I'll review this PR for you. Let me gather the information about the changes first.


🏁 Script executed:

#!/bin/bash
# Get PR information and files changed
gh pr view 15732 --repo ethereum/ethereum-org-website --json title,body,files,additions,deletions,changedFiles

# Get the diff for the PR
gh pr diff 15732 --repo ethereum/ethereum-org-website

Length of output: 1875


Perfect! I can see this is a straightforward i18n fix. Let me examine the file structure and translation patterns to ensure this change is consistent with the codebase.


🏁 Script executed:

#!/bin/bash
# Check the actual file to understand the getTranslations call
cat "app/[locale]/developers/learning-tools/page.tsx"

# Look for similar patterns in other page.tsx files to see how translations are typically handled
fd -e tsx -x grep -l "generateMetadata" {} \; | head -5 | xargs grep -A 10 -B 2 "getTranslations\|title: t("

# Check if there are translation files with these keys
fd -e json -e ts -e js | grep -i "translation\|locale\|i18n" | head -5

Length of output: 17796


✅ Excellent Fix!

@konopkja This is a perfect fix for the i18n issue. I can confirm that:

The Problem: The page was showing the raw translation key "page-developers-learning-tools-meta-title" instead of the translated text due to double-referencing the namespace.

The Root Cause:

  • getTranslations() was called with namespace: "page-developers-learning-tools"
  • But then the translation keys included the namespace prefix again: "page-developers-learning-tools:page-learning-tools-meta-title"
  • This caused the system to look for a non-existent key like "page-developers-learning-tools:page-developers-learning-tools:page-learning-tools-meta-title"

The Fix is Correct: Your changes align perfectly with the established codebase patterns. I verified this by checking other similar files:

// ✅ Correct pattern used everywhere else:
const t = await getTranslations({ locale, namespace: "page-stablecoins" })
title: t("page-stablecoins-meta-title") // No namespace prefix

// ❌ The original problematic code:
const t = await getTranslations({ locale, namespace: "page-developers-learning-tools" })
title: t("page-developers-learning-tools:page-learning-tools-meta-title") // Double namespace

Code Quality:

  • ✅ Follows established conventions
  • ✅ Minimal, targeted change
  • ✅ Proper fix for the root cause
  • ✅ Should resolve the display issue completely

The PR is ready to merge! This will fix the broken page title and make it display "Developer learning tools" as intended.

🐰 Happy to see a clean i18n fix that follows the codebase patterns perfectly!

@wackerow wackerow merged commit 433567e into dev Jul 15, 2025
6 checks passed
@wackerow wackerow deleted the claude/issue-15731-20250627_094636 branch July 15, 2025 22:56
This was referenced Jul 16, 2025
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.

Bug report: missing page title

2 participants