diff --git a/src/app/(routes)/(website)/[...notFound]/page.tsx b/src/app/(routes)/(website)/[...notFound]/page.tsx index 37155ea..9269354 100644 --- a/src/app/(routes)/(website)/[...notFound]/page.tsx +++ b/src/app/(routes)/(website)/[...notFound]/page.tsx @@ -9,13 +9,18 @@ interface PropsType { params: Promise<{ notFound: string[]; }>; + searchParams?: Promise<{ + lang?: string; + }>; } export default async function NotFound(props: PropsType) { const params = await props.params; + const searchParams = props.searchParams ? await props.searchParams : {}; const requestedPath = "/" + params.notFound.join("/"); const imageUrl = `/images/404/${pickStableIndex(requestedPath, NOT_FOUND_ILLUSTRATIONS) + 1}.jpg`; - const locale = await getDefaultLocale(); + const defaultLocale = await getDefaultLocale(); + const locale = searchParams?.lang || defaultLocale; const isFa = locale === "fa"; return ( diff --git a/src/app/(routes)/blog/[...notFound]/page.tsx b/src/app/(routes)/blog/[...notFound]/page.tsx index 1674362..a8853ab 100644 --- a/src/app/(routes)/blog/[...notFound]/page.tsx +++ b/src/app/(routes)/blog/[...notFound]/page.tsx @@ -9,13 +9,18 @@ interface PropsType { params: Promise<{ notFound: string[]; }>; + searchParams?: Promise<{ + lang?: string; + }>; } export default async function NotFound(props: PropsType) { const params = await props.params; + const searchParams = props.searchParams ? await props.searchParams : {}; const requestedPath = params.notFound.join("/"); const imageUrl = `/images/404/${pickStableIndex(requestedPath, NOT_FOUND_ILLUSTRATIONS) + 1}.jpg`; - const locale = await getDefaultLocale(); + const defaultLocale = await getDefaultLocale(); + const locale = searchParams?.lang || defaultLocale; const isFa = locale === "fa"; return (