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

v3 - translate full path #781

Merged
merged 4 commits into from
Oct 16, 2024
Merged

v3 - translate full path #781

merged 4 commits into from
Oct 16, 2024

Conversation

mathiazom
Copy link
Contributor

@mathiazom mathiazom commented Oct 15, 2024

See #733

The useLanguage client hook has been removed in favor of providing the path translation together with the page data. This also means that the translations are fetched on the server instead of on the client.

In order to allow this, the header component has been moved from the root layout.tsx to each page. This is because the LanguageSwitcher in Header needs access to the page data, which is not available in layout.tsx. This approach is similar to the Sanity example project demo-course-platform.

Copy link

vercel bot commented Oct 15, 2024

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

Name Status Preview Comments Updated (UTC)
variant-no ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 16, 2024 11:43am
variant-se-2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 16, 2024 11:43am

@mathiazom mathiazom force-pushed the feat/v3-translate-full-path branch from c1d689e to c46a79f Compare October 15, 2024 10:59
@mathiazom mathiazom force-pushed the feat/v3-translate-full-path branch from c46a79f to daa1fc0 Compare October 16, 2024 09:32
@mathiazom mathiazom marked this pull request as ready for review October 16, 2024 09:36
@mathiazom mathiazom force-pushed the feat/v3-translate-full-path branch from daa1fc0 to c9e00be Compare October 16, 2024 10:15
@mathiazom mathiazom force-pushed the feat/v3-translate-full-path branch from c9e00be to f126352 Compare October 16, 2024 10:43
@mathiazom mathiazom changed the base branch from v3 to refactor/v3-query-response-type-narrowing October 16, 2024 10:43
@mathiazom mathiazom force-pushed the feat/v3-translate-full-path branch from f126352 to 7c95f84 Compare October 16, 2024 10:50
@mathiazom mathiazom requested a review from anemne October 16, 2024 10:52
Base automatically changed from refactor/v3-query-response-type-narrowing to v3 October 16, 2024 10:52
…guage, before checking other languages

given pages `/en/gift`,`/no/gave`,`/en/poison`,`/no/gift` and user language `en`, we should redirect `/gift` to `/en/poison` and not `/en/gift`
@mathiazom mathiazom merged commit 053e1d0 into v3 Oct 16, 2024
6 checks passed
@mathiazom mathiazom deleted the feat/v3-translate-full-path branch October 16, 2024 12:03
@mathiazom mathiazom linked an issue Oct 16, 2024 that may be closed by this pull request
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.

Full path translation
2 participants