Skip to content

Conversation

@pettinarip
Copy link
Member

@pettinarip pettinarip commented Dec 4, 2025

Built on top of #16804

Description

Fixes hreflang tags to only include translated locales.

High-level changes

  • filters hreflang tags to only include locales with translations
  • sets canonical URL to english version + index, follow metatag for untranslated pages
  • sitemap only generate entries for translated content

Implementation details

Hreflang fix in getMetadata()

  • filters hreflang tags to only include locales with translations
  • sets canonical URL to english version for untranslated pages

Refactor src/lib/utils/translations.ts

  • made to get all intl translated pages easily (used in the sitemap generation)
  • refactored from hardcoded if-statements to data-driven approach

Unified translation registry (src/lib/i18n/translationRegistry.ts)

  • created getTranslatedLocales() to check translation status for both MD and intl pages
  • single source of truth for translation status used by both metadata and sitemap

Sitemap refactor (app/sitemap.ts)

  • removed old next-sitemap plugin to use a the builtin sitemap.ts file
  • uses getAllPagesWithTranslations() from translation registry
  • only includes URLs for pages that are actually translated in each locale
  • ensures sitemap and page metadata use the same translation detection logic

@netlify
Copy link

netlify bot commented Dec 4, 2025

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 1fcc157
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/69396902c71ce400086b19dc
😎 Deploy Preview https://deploy-preview-16790--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: 47 (🔴 down 5 from production)
Accessibility: 94 (no change from production)
Best Practices: 92 (🔴 down 8 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.

@github-actions github-actions bot added the tooling 🔧 Changes related to tooling of the project label Dec 4, 2025
@pettinarip pettinarip force-pushed the fix-hreflangs-untranslated-pages branch 2 times, most recently from 97a94c8 to 367df59 Compare December 4, 2025 19:08
@github-actions github-actions bot added config ⚙️ Changes to configuration files dependencies 📦 Changes related to project dependencies labels Dec 4, 2025
@pettinarip pettinarip force-pushed the fix-hreflangs-untranslated-pages branch from 58615d0 to 904a760 Compare December 6, 2025 08:17
@github-actions github-actions bot added content 🖋️ This involves copy additions or edits translation 🌍 This is related to our Translation Program labels Dec 6, 2025
@pettinarip pettinarip changed the base branch from dev to exclude-fil-pcm-b8f83 December 6, 2025 12:01
@pettinarip pettinarip force-pushed the exclude-fil-pcm-b8f83 branch from 0a6b18e to 79e067e Compare December 8, 2025 13:47
@pettinarip pettinarip marked this pull request as ready for review December 8, 2025 14:48
corwintines
corwintines previously approved these changes Dec 8, 2025
Base automatically changed from exclude-fil-pcm-b8f83 to master December 9, 2025 20:07
@pettinarip pettinarip dismissed corwintines’s stale review December 9, 2025 20:07

The base branch was changed.

@pettinarip
Copy link
Member Author

Detected a bug. We are missing the following pages from the sitemap:

  • /10years
  • /contributing/translation-program/translatathon/leaderboard
  • /enterprise
  • /ethereum-history-founder-and-ownership
  • /ethereum-vs-bitcoin
  • /founders
  • /quizzes
  • /trillion-dollar-security
  • /what-is-ether
  • /what-is-the-ethereum-network

These pages don’t use a namespace for translations, so they aren’t listed in the translation registry.

We’ll need a different approach to discover intl pages. Instead of pulling them from the registry, I’ll switch to detecting them by scanning the filesystem.

@pettinarip pettinarip merged commit 3e99fe6 into master Dec 10, 2025
11 checks passed
@pettinarip pettinarip deleted the fix-hreflangs-untranslated-pages branch December 10, 2025 16:53
This was referenced Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config ⚙️ Changes to configuration files content 🖋️ This involves copy additions or edits dependencies 📦 Changes related to project dependencies tooling 🔧 Changes related to tooling of the project translation 🌍 This is related to our Translation Program

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants