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

[B2BP-797] First Implementation of i18n (PoC) #414

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

Conversation

simosalsi
Copy link
Collaborator

@simosalsi simosalsi commented Aug 30, 2024

This branch contains the first implementation of internationalization (i18n) / multi-language.

List of Changes

Strapi

  • Activated i18n for Pages, Header, PreHeader, Footer
  • General has not been internationalized and as such a locales field to determine which locales to render has been added to it. (If we were to apply i18n to General, the locales field would need to be moved to a new Languages Single Type, since the field has to belong to a non-i18n Single Type)
    NextJS
  • Updated logic to first fetch locales to render from General and afterwards, using said locales in the API calls to Strapi
  • Prepended locale to Header links --> (We are going to have to do this to all links in all components)
  • Made it so Footer's LangSwitch links to the homepage of each locale (we are currently linking to the homepage because we have no certainty that each page has a corresponding page in each locale and that their slug is the same)
  • Updated preview to fetch all page IDs from all locales

Motivation and Context

Multi-Language is requested for the final version of the product.

How Has This Been Tested?

Ran locally in dev and build, generating static files.

Screenshots (if appropriate):

Types of changes

  • Chore (nothing changes by a user perspective)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Copy link

changeset-bot bot commented Aug 30, 2024

⚠️ No Changeset found

Latest commit: d6a59be

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov-commenter
Copy link

codecov-commenter commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 31.91489% with 64 lines in your changes missing coverage. Please review.

Project coverage is 92.75%. Comparing base (5b213dd) to head (d6a59be).

Files with missing lines Patch % Lines
apps/nextjs-website/src/lib/header.ts 5.88% 64 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #414      +/-   ##
==========================================
- Coverage   98.35%   92.75%   -5.61%     
==========================================
  Files          20       20              
  Lines        1035     1118      +83     
  Branches       38       38              
==========================================
+ Hits         1018     1037      +19     
- Misses         17       81      +64     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Sep 5, 2024

This PR exceeds the recommended size of 600 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link
Contributor

github-actions bot commented Sep 5, 2024

Jira Pull Request Link

This Pull Request refers to the following Jira issue B2BP-797

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants