* move setLang() to a root layout

* fix: findLang only returns acceptable languages
* fix: fallback to use header x-lang if we haven't setLang yet
* fix: languageSchema, allow uppercase

Approved-by: Linus Flood
This commit is contained in:
Joakim Jäderberg
2025-02-19 09:06:37 +00:00
parent d27163a915
commit 873183ec2f
45 changed files with 159 additions and 117 deletions

View File

@@ -2,15 +2,12 @@ import { Suspense } from "react"
import { MyStay } from "@/components/HotelReservation/MyStay"
import { MyStaySkeleton } from "@/components/HotelReservation/MyStay/myStaySkeleton"
import { setLang } from "@/i18n/serverContext"
import type { LangParams, PageArgs } from "@/types/params"
export default async function MyStayPage({
params,
}: PageArgs<LangParams & { refId: string }>) {
setLang(params.lang)
return (
<Suspense fallback={<MyStaySkeleton />}>
<MyStay reservationId={params.refId} />