Skip to content

[UXIT-3888] Move metadata texts to translations#2156

Merged
CharlyMartin merged 4 commits intomainfrom
UXIT-3888/i18n-metadata
Feb 11, 2026
Merged

[UXIT-3888] Move metadata texts to translations#2156
CharlyMartin merged 4 commits intomainfrom
UXIT-3888/i18n-metadata

Conversation

@CharlyMartin
Copy link
Copy Markdown
Collaborator

@CharlyMartin CharlyMartin commented Feb 9, 2026

📝 Description

This PR adds i18n support for metadata by moving SEO metadata from hardcoded constants to translation files.

🛠️ Key Changes

  • Created getTranslatedMetadata utility for consistent metadata fetching via next-intl
  • Moved metadata from constants/seo.ts to i18n/translations/en.json and i18n/translations/zh-cn.json. For now, Chinese translations are marked as TODO.
  • Removed all constants/seo.ts
  • Updated Cypress tests to handle translation-based metadata.

Note

Cypress currently only tests English pages. Chinese support will be done in another PR.

🧪 How to Test

  1. npx turbo filecoin-site#dev
  2. Visit all updated pages in both English and Chinese locales
  3. Inspect page <title> and <meta name="description"> tags
  4. Verify metadata matches translations/*.json files

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
filecoin-site Ready Ready Preview, Comment Feb 11, 2026 7:09pm
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
ffdweb-site Skipped Skipped Feb 11, 2026 7:09pm
filecoin-foundation-site Skipped Skipped Feb 11, 2026 7:09pm
filecoin-foundation-uxit Skipped Skipped Feb 11, 2026 7:09pm

Request Review

@notion-workspace
Copy link
Copy Markdown

@github-actions github-actions Bot added the size/L label Feb 9, 2026
@CharlyMartin CharlyMartin marked this pull request as draft February 9, 2026 17:50
@CharlyMartin CharlyMartin changed the title Move metadata texts to translations [UXIT-3888] Move metadata texts to translations Feb 9, 2026
@CharlyMartin CharlyMartin force-pushed the UXIT-3888/i18n-metadata branch from fdd4a99 to beb31dd Compare February 10, 2026 11:59
@vercel vercel Bot temporarily deployed to Preview – ffdweb-site February 10, 2026 11:59 Inactive
@vercel vercel Bot temporarily deployed to Preview – filecoin-foundation-site February 10, 2026 11:59 Inactive
@vercel vercel Bot temporarily deployed to Preview – filecoin-foundation-uxit February 10, 2026 11:59 Inactive
@github-actions github-actions Bot added size/L and removed size/L labels Feb 10, 2026
@vercel vercel Bot temporarily deployed to Preview – filecoin-foundation-site February 10, 2026 14:59 Inactive
@vercel vercel Bot temporarily deployed to Preview – filecoin-foundation-uxit February 10, 2026 14:59 Inactive
@vercel vercel Bot temporarily deployed to Preview – ffdweb-site February 10, 2026 14:59 Inactive
@github-actions github-actions Bot added size/L and removed size/L labels Feb 10, 2026
@CharlyMartin CharlyMartin marked this pull request as ready for review February 10, 2026 15:07
Copy link
Copy Markdown
Contributor

@barbaraperic barbaraperic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR, but we should probably add translation button to mobile?

Image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an idea!

What do you think if we included translationKey in the PATHS object? In that way path and translation namespace live together - when you work on a route, you see path, label and which i18n key it uses.

So if we have something like this

type PathConfig = {
  path: NextRouteWithoutLocale
  label: string
  entriesPath?: string
  translationKey?: TranslationKey
}

export const PATHS = {
  BLOG: {
    path: '/blog',
    label: 'Blog',
    entriesPath: `${CONTENT_ROOT}/blog/posts`,
    translationKey: 'blog',
  },
...
}

in the page we can do:

const { translationKey } = PATHS.BLOG

const metadata = await getTranslatedMetadata(translationKey)

and in the tests:

const { path, translationKey } = PATHS.BLOG

const { title, description } = translations[translationKey].metadata

That way we can make sure that path and key stays in sync, and we don't have to use string literals like TRANSLATION_NAMESPACE.

Hope it makes sense!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that makes a lot of sense. I will give it a try! Thanks :)

Replaced direct `getTranslations` calls with `getTranslatedMetadata` in homepage,
blog, and community-hub pages. This centralizes translated metadata extraction
for `StructuredDataScript` and `generateMetadata`, reducing duplication and
improving consistency in i18n handling.
@CharlyMartin CharlyMartin force-pushed the UXIT-3888/i18n-metadata branch from bcdd596 to eeca453 Compare February 11, 2026 18:38
@vercel vercel Bot temporarily deployed to Preview – filecoin-foundation-site February 11, 2026 18:38 Inactive
@vercel vercel Bot temporarily deployed to Preview – ffdweb-site February 11, 2026 18:38 Inactive
@vercel vercel Bot temporarily deployed to Preview – filecoin-foundation-uxit February 11, 2026 18:38 Inactive
@github-actions github-actions Bot removed the size/L label Feb 11, 2026
@CharlyMartin CharlyMartin force-pushed the UXIT-3888/i18n-metadata branch from eeca453 to b3bcfce Compare February 11, 2026 19:05
@vercel vercel Bot temporarily deployed to Preview – ffdweb-site February 11, 2026 19:05 Inactive
@vercel vercel Bot temporarily deployed to Preview – filecoin-foundation-uxit February 11, 2026 19:05 Inactive
@vercel vercel Bot temporarily deployed to Preview – filecoin-foundation-site February 11, 2026 19:05 Inactive
@github-actions github-actions Bot added size/L and removed size/L labels Feb 11, 2026
@CharlyMartin CharlyMartin merged commit 005ed1b into main Feb 11, 2026
10 of 11 checks passed
@CharlyMartin CharlyMartin deleted the UXIT-3888/i18n-metadata branch February 11, 2026 19:15
@github-actions github-actions Bot added size/L and removed size/L labels Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants