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

[WIP] Enable translation of news posts #269

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

manio143
Copy link
Member

Motivation

Currently all news posts have been added to the English locale in Prismic, which results in more entries on the /news/ page. Instead we want to only show the English post on the list of articles and then allow the user to use a dropdown in the page header to select another language.

How it works

Writer will create translations in Primis by selecting another language in the Prismic UI and using the same UID as the original article. This way in the site we have a page /[locale]/news/[uid] that will pull down the translated version of the article. By using language picker on the site the user will modify the [locale] part of the url and get another version of the article from Prismic. If a translation is not available for a given post in a given language we will display a fallback message in that language with a link pointing back to original article.

Changes

  • Updated packages
  • Added Turkish and Italian to the list of languages based on posts for name change announcement
  • Limited language picker to only news articles
  • Explicitly using default language for header and footer
  • Redirect back to default language for non news pages until they get translated
  • Show a fallback page if translation is not available
  • Get translation team to prepare fallback page content

@vercel
Copy link

vercel bot commented Aug 16, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
iqasport-com ❌ Failed (Inspect) Aug 16, 2022 at 8:00AM (UTC)

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.

1 participant