diff --git a/public/images/icons/burger-menu.svg b/public/images/icons/burger-menu.svg
index 9ddd45b..20a7de4 100644
--- a/public/images/icons/burger-menu.svg
+++ b/public/images/icons/burger-menu.svg
@@ -1,6 +1,6 @@
\ No newline at end of file
diff --git a/src/app/(routes)/(website)/[...notFound]/page.tsx b/src/app/(routes)/(website)/[...notFound]/page.tsx
index a4c5db4..37155ea 100644
--- a/src/app/(routes)/(website)/[...notFound]/page.tsx
+++ b/src/app/(routes)/(website)/[...notFound]/page.tsx
@@ -1,7 +1,7 @@
import Image from "next/image";
import Link from "next/link";
-
import { pickStableIndex } from "@/app/lib/functions/client-utils";
+import { getDefaultLocale } from "@/app/lib/functions/utils";
const NOT_FOUND_ILLUSTRATIONS = 5;
@@ -13,25 +13,37 @@ interface PropsType {
export default async function NotFound(props: PropsType) {
const params = await props.params;
- const requestedPath = params.notFound.join("/");
+ const requestedPath = "/" + params.notFound.join("/");
const imageUrl = `/images/404/${pickStableIndex(requestedPath, NOT_FOUND_ILLUSTRATIONS) + 1}.jpg`;
+ const locale = await getDefaultLocale();
+ const isFa = locale === "fa";
return (
-
-
-
Nothing Found!
-
- Could not find{" "}
-
- /blog/{requestedPath}
- {" "}
- !
+
+
+
+
+
+ {isFa ? "صفحه مورد نظر یافت نشد!" : "Nothing Found!"}
+
+
+ {isFa ? "مسیر " : "Could not find "}
+
+ {requestedPath}
+
+ {isFa ? " در دسترس نیست یا جابهجا شده است." : " !"}
- Return Home
+ {isFa ? "بازگشت به صفحه اصلی" : "Return Home"}
);
diff --git a/src/app/(routes)/(website)/components/selectLanguage/selectLanguage.tsx b/src/app/(routes)/(website)/components/selectLanguage/selectLanguage.tsx
index 2d249ac..3e39529 100644
--- a/src/app/(routes)/(website)/components/selectLanguage/selectLanguage.tsx
+++ b/src/app/(routes)/(website)/components/selectLanguage/selectLanguage.tsx
@@ -48,7 +48,7 @@ export default function SelectLanguage() {
}`}
>
{
e.preventDefault();
@@ -58,7 +58,7 @@ export default function SelectLanguage() {
فارسی
{
e.preventDefault();
diff --git a/src/app/(routes)/(website)/components/testimonials/testimonials.tsx b/src/app/(routes)/(website)/components/testimonials/testimonials.tsx
index fb44e59..914ac40 100644
--- a/src/app/(routes)/(website)/components/testimonials/testimonials.tsx
+++ b/src/app/(routes)/(website)/components/testimonials/testimonials.tsx
@@ -108,6 +108,7 @@ export default function Testimonials({ dict }: TestimonialsProps) {
src={getCleanImgSrc(testimonial.image)}
alt={testimonial.name}
fill
+ sizes="48px"
className="object-cover"
/>
diff --git a/src/app/(routes)/(website)/layout.tsx b/src/app/(routes)/(website)/layout.tsx
index 126440f..8c2c851 100644
--- a/src/app/(routes)/(website)/layout.tsx
+++ b/src/app/(routes)/(website)/layout.tsx
@@ -48,11 +48,11 @@ export const metadata: Metadata = {
creator: SITE_NAME,
publisher: SITE_NAME,
alternates: {
- canonical: "./",
+ canonical: "/",
languages: {
- fa: "./",
- en: "./",
- "x-default": "./",
+ fa: "/?lang=fa",
+ en: "/?lang=en",
+ "x-default": "/",
},
},
openGraph: {
diff --git a/src/app/(routes)/blog/[...notFound]/page.tsx b/src/app/(routes)/blog/[...notFound]/page.tsx
index 53f6b0b..1674362 100644
--- a/src/app/(routes)/blog/[...notFound]/page.tsx
+++ b/src/app/(routes)/blog/[...notFound]/page.tsx
@@ -1,7 +1,7 @@
import Image from "next/image";
import Link from "next/link";
-
import { pickStableIndex } from "@/app/lib/functions/client-utils";
+import { getDefaultLocale } from "@/app/lib/functions/utils";
const NOT_FOUND_ILLUSTRATIONS = 5;
@@ -15,29 +15,35 @@ export default async function NotFound(props: PropsType) {
const params = await props.params;
const requestedPath = params.notFound.join("/");
const imageUrl = `/images/404/${pickStableIndex(requestedPath, NOT_FOUND_ILLUSTRATIONS) + 1}.jpg`;
+ const locale = await getDefaultLocale();
+ const isFa = locale === "fa";
return (
-
-
-
Nothing Found!
-
- Could not find{" "}
-
+
+
+
+
+
+ {isFa ? "مطلب یا صفحه مورد نظر یافت نشد!" : "Nothing Found!"}
+
+
+ {isFa ? "آدرس " : "Could not find "}
+
/blog/{requestedPath}
- {" "}
- !
+
+ {isFa ? " پیدا نشد." : " !"}
- Return Home
+ {isFa ? "بازگشت به وبلاگ" : "Return to Blog"}
);
diff --git a/src/app/(routes)/blog/components/header/header.tsx b/src/app/(routes)/blog/components/header/header.tsx
index 17f05e9..5d0cb82 100644
--- a/src/app/(routes)/blog/components/header/header.tsx
+++ b/src/app/(routes)/blog/components/header/header.tsx
@@ -18,8 +18,8 @@ export default async function Header() {
};
return (
-
-
+
+
- changeLocale("fa")}
+ onClick={(e) => {
+ e.preventDefault();
+ changeLocale("fa");
+ }}
>
فارسی
-
-
+ changeLocale("en")}
+ onClick={(e) => {
+ e.preventDefault();
+ changeLocale("en");
+ }}
>
English
-
+
);
diff --git a/src/app/(routes)/blog/layout.tsx b/src/app/(routes)/blog/layout.tsx
index de0d439..8c35bd2 100644
--- a/src/app/(routes)/blog/layout.tsx
+++ b/src/app/(routes)/blog/layout.tsx
@@ -17,8 +17,8 @@ export const metadata: Metadata = {
alternates: {
canonical: "/blog",
languages: {
- en: "/blog",
- fa: "/blog",
+ en: "/blog?lang=en",
+ fa: "/blog?lang=fa",
"x-default": "/blog",
},
},
@@ -59,7 +59,7 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
-