fix(404): read lang from searchParams for dynamic localization on 404 pages
Deploy Frontend / deploy (push) Successful in 1m7s

This commit is contained in:
Parsa Aghayi committed 2026-11-02 08:30:18 +00:00
1 parent efe9a29adb
commit 3f47fc5e0e
2 files changed
+12 -2

No files matched your search

@@ -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 (
+6 -1
View File
@@ -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 (