fix(404): read lang from searchParams for dynamic localization on 404 pages
Deploy Frontend / deploy (push) Successful in 1m7s
Deploy Frontend / deploy (push) Successful in 1m7s
This commit is contained in:
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 (
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in new issue
Block a user