[UXIT-3888] Move metadata texts to translations#2156
Merged
CharlyMartin merged 4 commits intomainfrom Feb 11, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
fdd4a99 to
beb31dd
Compare
Contributor
There was a problem hiding this comment.
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].metadataThat 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!
Collaborator
Author
There was a problem hiding this comment.
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.
bcdd596 to
eeca453
Compare
eeca453 to
b3bcfce
Compare
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.

📝 Description
This PR adds i18n support for metadata by moving SEO metadata from hardcoded constants to translation files.
🛠️ Key Changes
getTranslatedMetadatautility for consistent metadata fetching vianext-intlconstants/seo.tstoi18n/translations/en.jsonandi18n/translations/zh-cn.json. For now, Chinese translations are marked asTODO.constants/seo.tsNote
Cypress currently only tests English pages. Chinese support will be done in another PR.
🧪 How to Test
npx turbo filecoin-site#dev<title>and<meta name="description">tagstranslations/*.jsonfiles