Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

link translated content #5

Open
babslgam opened this issue Jan 14, 2025 · 3 comments
Open

link translated content #5

babslgam opened this issue Jan 14, 2025 · 3 comments

Comments

@babslgam
Copy link
Collaborator

@stefanprobst, how should the relation between entries be handled, where on entry represents the translation of another entry?

i would introduce a relationship field like "translationOf" to let the user select the original entry.

But how to proceed from there? should we introduce some logic in sitemap.ts (i.e. generate a mapping between entry slugs based on the new field, which could also give as the benefit of being able to create a localized sitemap https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap#generate-a-localized-sitemap) and reuse this logic in the localswitcher component? or would we use some Provider?

@stefanprobst
Copy link
Contributor

stefanprobst commented Jan 14, 2025

the current i18n setup assumes that all content exists in all supported languages.

as long as the slugs match,

  • switching between /de/events/my-event and /en/events/my-event will work.
  • the google bot will know about language alternates via headers (so no need to add these to the sitemap as well).

to decide if this needs to change, we should clarify

  • whether we can actually assume that all content will exist in all supported languages
  • whether it is reasonable to require that content authors use matching slug for the same content in different languages

@babslgam
Copy link
Collaborator Author

to decide if this needs to change, we should clarify

- whether we can actually assume that all content will exist in all supported languages

- whether it is reasonable to require that content authors use matching slug for the same content in different languages

@vronk can you please add the relevant info to the specification document? thank you.

@stefanprobst
Copy link
Contributor

answers are (i) yes, and (ii) yes.

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

No branches or pull requests

2 participants