fix: localize 404 and ensure header when no lang
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { getIntl } from "@/i18n"
|
||||
import { headers } from "next/headers"
|
||||
|
||||
export default async function NotFound() {
|
||||
const { formatMessage } = await getIntl()
|
||||
return (
|
||||
<main>
|
||||
<h1>{formatMessage({ id: "Not found" })}</h1>
|
||||
<p>{formatMessage({ id: "Could not find requested resource" })}</p>
|
||||
</main>
|
||||
)
|
||||
import { Lang } from "@/constants/languages"
|
||||
|
||||
import NotFound from "@/components/Current/NotFound"
|
||||
|
||||
export default function NotFoundPage() {
|
||||
const headersList = headers()
|
||||
const lang = headersList.get("x-sh-language") as Lang
|
||||
|
||||
return <NotFound lang={lang} />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user