diff --git a/messages/ar.json b/messages/ar.json
new file mode 100644
index 0000000..b032df1
--- /dev/null
+++ b/messages/ar.json
@@ -0,0 +1,5 @@
+{
+ "Home": {
+ "title": "goodbye"
+ }
+}
diff --git a/messages/en.json b/messages/en.json
index 5fa1a11..6e88cea 100644
--- a/messages/en.json
+++ b/messages/en.json
@@ -1,5 +1,5 @@
{
- "Home": {
- "title": "Title"
- }
+ "Home": {
+ "title": "hello"
+ }
}
diff --git a/messages/fa.json b/messages/fa.json
deleted file mode 100644
index 24e9065..0000000
--- a/messages/fa.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "loading": "درحال دریافت داده",
- "error_fetch_data": "مشکلی در دریافت داده رخ داده است."
-}
diff --git a/next-env.d.ts b/next-env.d.ts
index 9edff1c..c4b7818 100644
--- a/next-env.d.ts
+++ b/next-env.d.ts
@@ -1,6 +1,6 @@
///
///
-import "./.next/types/routes.d.ts";
+import "./.next/dev/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
diff --git a/src/i18n/direction.ts b/src/i18n/direction.ts
index 73e8067..5e85339 100644
--- a/src/i18n/direction.ts
+++ b/src/i18n/direction.ts
@@ -1,10 +1,10 @@
-export type Direction = 'ltr' | 'rtl'
+export type Direction = "ltr" | "rtl";
export const localeDirectionMap: Record = {
- en: 'ltr',
- fa: 'rtl',
-}
+ en: "ltr",
+ ar: "rtl",
+};
export function getDirection(locale: string): Direction {
- return localeDirectionMap[locale] ?? 'ltr'
+ return localeDirectionMap[locale] ?? "ltr";
}
diff --git a/src/i18n/request.ts b/src/i18n/request.ts
index 76cadd2..78ab40c 100644
--- a/src/i18n/request.ts
+++ b/src/i18n/request.ts
@@ -6,6 +6,8 @@ export default getRequestConfig(async ({ requestLocale }) => {
const requested = await requestLocale;
const locale = hasLocale(routing.locales, requested) ? requested : routing.defaultLocale;
+ console.log("locale: ", locale);
+
return {
locale,
messages: (await import(`../../messages/${locale}.json`)).default,
diff --git a/src/i18n/routing.ts b/src/i18n/routing.ts
index 0f6e04d..4a93171 100644
--- a/src/i18n/routing.ts
+++ b/src/i18n/routing.ts
@@ -1,8 +1,7 @@
-import { defineRouting } from 'next-intl/routing'
+import { defineRouting } from "next-intl/routing";
export const routing = defineRouting({
- locales: ['en', 'fa'],
- defaultLocale: 'en',
- localePrefix: 'never',
- localeDetection: false,
-})
+ locales: ["en", "ar"],
+ defaultLocale: "en",
+ localePrefix: "never",
+});