From 694596db999adf20359ae5d9dc21ef81fdd53fec Mon Sep 17 00:00:00 2001 From: Ayinkx Date: Wed, 22 Jul 2026 15:43:29 -0700 Subject: [PATCH] feat: add next-intl RTL Arabic support (#104) --- app/(pages)/(landingPage)/WhyDeenBridge.jsx | 93 - .../(pages)/(auth)/login/page.jsx | 0 .../(pages)/(auth)/signup/page.jsx | 0 .../(pages)/(landingPage)/About.jsx | 20 +- .../(pages)/(landingPage)/CTA.jsx | 9 +- .../(pages)/(landingPage)/Footer.jsx | 33 +- .../(pages)/(landingPage)/Hero.jsx | 13 +- .../(pages)/(landingPage)/HowItWorks.jsx | 4 +- .../(pages)/(landingPage)/Partners.jsx | 0 .../(pages)/(landingPage)/Stats.jsx | 0 .../(pages)/(landingPage)/Testimonials.jsx | 4 +- .../(pages)/(landingPage)/WhyDeenBridge.jsx | 49 + app/{ => [locale]}/(pages)/blog/layout.jsx | 0 app/{ => [locale]}/(pages)/blog/page.jsx | 0 app/{ => [locale]}/account/layout.jsx | 0 .../account/notifications/page.jsx | 0 .../account/profile/[profileid]/page.jsx | 0 app/{ => [locale]}/account/security/page.jsx | 0 app/{ => [locale]}/account/settings/page.jsx | 0 app/{ => [locale]}/account/support/page.jsx | 0 app/{ => [locale]}/account/wallet/page.jsx | 0 app/{ => [locale]}/dashboard/ai/layout.js | 0 app/{ => [locale]}/dashboard/ai/page.jsx | 0 .../[courseId]/CourseDetailPageClient.jsx | 0 .../dashboard/courses/[courseId]/page.jsx | 0 app/{ => [locale]}/dashboard/courses/page.jsx | 0 app/{ => [locale]}/dashboard/layout.jsx | 0 .../library/[bookid]/BookDetailPageClient.jsx | 0 .../dashboard/library/[bookid]/page.jsx | 0 app/{ => [locale]}/dashboard/library/page.jsx | 0 .../read/[bookid]/BookReaderClient.jsx | 0 .../dashboard/library/read/[bookid]/page.jsx | 0 .../dashboard/messages/[room]/page.jsx | 0 .../dashboard/messages/layout.js | 0 .../dashboard/messages/page.jsx | 0 app/{ => [locale]}/dashboard/page.jsx | 0 app/{ => [locale]}/dashboard/reels/page.jsx | 0 app/{ => [locale]}/dashboard/sadaqah/page.jsx | 0 .../dashboard/search/[searchparam]/page.jsx | 0 .../dashboard/spaces/[spacesid]/page.jsx | 0 app/{ => [locale]}/dashboard/spaces/page.jsx | 0 app/{ => [locale]}/layout.js | 31 +- app/{ => [locale]}/loading.jsx | 0 app/{ => [locale]}/not-found.js | 0 app/{ => [locale]}/page.jsx | 0 app/{ => [locale]}/profile-setup/page.jsx | 0 components/i18n/LocaleSwitcher.jsx | 26 + components/molecules/dashboard/nav-header.jsx | 10 +- components/molecules/dashboard/nav-main.jsx | 4 +- .../molecules/dashboard/nav-routers.jsx | 8 +- components/molecules/ladingpage/Navbar.jsx | 30 +- .../organisms/dashboard/sidebar-left.jsx | 2 +- components/stellar/WalletConnectButton.jsx | 6 +- i18n/navigation.js | 5 + i18n/request.js | 15 + i18n/routing.js | 7 + messages/ar.json | 13 + messages/en.json | 14 + middleware.js | 8 + next.config.mjs | 4 +- package-lock.json | 1570 +++++++++-------- package.json | 1 + styles/globals.css | 4 + 63 files changed, 1043 insertions(+), 940 deletions(-) delete mode 100644 app/(pages)/(landingPage)/WhyDeenBridge.jsx rename app/{ => [locale]}/(pages)/(auth)/login/page.jsx (100%) rename app/{ => [locale]}/(pages)/(auth)/signup/page.jsx (100%) rename app/{ => [locale]}/(pages)/(landingPage)/About.jsx (65%) rename app/{ => [locale]}/(pages)/(landingPage)/CTA.jsx (78%) rename app/{ => [locale]}/(pages)/(landingPage)/Footer.jsx (72%) rename app/{ => [locale]}/(pages)/(landingPage)/Hero.jsx (75%) rename app/{ => [locale]}/(pages)/(landingPage)/HowItWorks.jsx (95%) rename app/{ => [locale]}/(pages)/(landingPage)/Partners.jsx (100%) rename app/{ => [locale]}/(pages)/(landingPage)/Stats.jsx (100%) rename app/{ => [locale]}/(pages)/(landingPage)/Testimonials.jsx (94%) create mode 100644 app/[locale]/(pages)/(landingPage)/WhyDeenBridge.jsx rename app/{ => [locale]}/(pages)/blog/layout.jsx (100%) rename app/{ => [locale]}/(pages)/blog/page.jsx (100%) rename app/{ => [locale]}/account/layout.jsx (100%) rename app/{ => [locale]}/account/notifications/page.jsx (100%) rename app/{ => [locale]}/account/profile/[profileid]/page.jsx (100%) rename app/{ => [locale]}/account/security/page.jsx (100%) rename app/{ => [locale]}/account/settings/page.jsx (100%) rename app/{ => [locale]}/account/support/page.jsx (100%) rename app/{ => [locale]}/account/wallet/page.jsx (100%) rename app/{ => [locale]}/dashboard/ai/layout.js (100%) rename app/{ => [locale]}/dashboard/ai/page.jsx (100%) rename app/{ => [locale]}/dashboard/courses/[courseId]/CourseDetailPageClient.jsx (100%) rename app/{ => [locale]}/dashboard/courses/[courseId]/page.jsx (100%) rename app/{ => [locale]}/dashboard/courses/page.jsx (100%) rename app/{ => [locale]}/dashboard/layout.jsx (100%) rename app/{ => [locale]}/dashboard/library/[bookid]/BookDetailPageClient.jsx (100%) rename app/{ => [locale]}/dashboard/library/[bookid]/page.jsx (100%) rename app/{ => [locale]}/dashboard/library/page.jsx (100%) rename app/{ => [locale]}/dashboard/library/read/[bookid]/BookReaderClient.jsx (100%) rename app/{ => [locale]}/dashboard/library/read/[bookid]/page.jsx (100%) rename app/{ => [locale]}/dashboard/messages/[room]/page.jsx (100%) rename app/{ => [locale]}/dashboard/messages/layout.js (100%) rename app/{ => [locale]}/dashboard/messages/page.jsx (100%) rename app/{ => [locale]}/dashboard/page.jsx (100%) rename app/{ => [locale]}/dashboard/reels/page.jsx (100%) rename app/{ => [locale]}/dashboard/sadaqah/page.jsx (100%) rename app/{ => [locale]}/dashboard/search/[searchparam]/page.jsx (100%) rename app/{ => [locale]}/dashboard/spaces/[spacesid]/page.jsx (100%) rename app/{ => [locale]}/dashboard/spaces/page.jsx (100%) rename app/{ => [locale]}/layout.js (60%) rename app/{ => [locale]}/loading.jsx (100%) rename app/{ => [locale]}/not-found.js (100%) rename app/{ => [locale]}/page.jsx (100%) rename app/{ => [locale]}/profile-setup/page.jsx (100%) create mode 100644 components/i18n/LocaleSwitcher.jsx create mode 100644 i18n/navigation.js create mode 100644 i18n/request.js create mode 100644 i18n/routing.js create mode 100644 messages/ar.json create mode 100644 messages/en.json create mode 100644 middleware.js diff --git a/app/(pages)/(landingPage)/WhyDeenBridge.jsx b/app/(pages)/(landingPage)/WhyDeenBridge.jsx deleted file mode 100644 index 0a2e26c0..00000000 --- a/app/(pages)/(landingPage)/WhyDeenBridge.jsx +++ /dev/null @@ -1,93 +0,0 @@ -"use client"; -import { - FaBookOpen, - FaUsers, - FaMosque, - FaShieldAlt, - FaHandsHelping, -} from "react-icons/fa"; -import { BsStars } from "react-icons/bs"; -import Button from "@/components/atoms/form/Button"; -import { cn } from "@/lib/utils"; -import { poppins_600 } from "@/lib/config/font.config"; - -const features = [ - { - icon: , - title: "Trusted Islamic Resources", - desc: "Access authentic knowledge, curated by scholars and trusted sources, to strengthen your Deen with confidence.", - }, - { - icon: , - title: "Supportive Community", - desc: "Connect with Muslims worldwide, share experiences, and grow together in a safe, welcoming environment.", - }, - { - icon: , - title: "Spaces & Events", - desc: "Join live sessions, discussions, and events designed to inspire, educate, and unite the Ummah.", - }, - { - icon: , - title: "Personalized Learning", - desc: "Discover books, courses, and resources tailored to your interests and spiritual journey.", - }, - { - icon: , - title: "Privacy & Security", - desc: "Your data and conversations are protected with industry-leading security and privacy standards.", - }, - { - icon: , - title: "Excellence in Every Step", - desc: "Experience a platform built for beauty, ease, and spiritual excellence—where Deen meets modern design.", - }, -]; - -export default function WhyDeenBridge() { - return ( -
- {/* Decorative Islamic motif background */} -
-
-
-
-
-

- Why Deen Bridge? -

-
- {features.map((f, i) => ( -
- {f.icon} -

- {f.title} -

-

- {f.desc} -

-
- ))} -
-
- -
-
-
- ); -} diff --git a/app/(pages)/(auth)/login/page.jsx b/app/[locale]/(pages)/(auth)/login/page.jsx similarity index 100% rename from app/(pages)/(auth)/login/page.jsx rename to app/[locale]/(pages)/(auth)/login/page.jsx diff --git a/app/(pages)/(auth)/signup/page.jsx b/app/[locale]/(pages)/(auth)/signup/page.jsx similarity index 100% rename from app/(pages)/(auth)/signup/page.jsx rename to app/[locale]/(pages)/(auth)/signup/page.jsx diff --git a/app/(pages)/(landingPage)/About.jsx b/app/[locale]/(pages)/(landingPage)/About.jsx similarity index 65% rename from app/(pages)/(landingPage)/About.jsx rename to app/[locale]/(pages)/(landingPage)/About.jsx index b59dd67a..63d10bee 100644 --- a/app/(pages)/(landingPage)/About.jsx +++ b/app/[locale]/(pages)/(landingPage)/About.jsx @@ -2,8 +2,10 @@ import React from "react"; import Image from "next/image"; import Button from "@/components/atoms/form/Button"; +import { useTranslations } from "next-intl"; const About = () => { + const t = useTranslations("landing.about"); return (
@@ -12,18 +14,12 @@ const About = () => {

- Where Deen Meets{" "} - Excellence + {t.rich("title", { emphasis: (chunks) => {chunks} })}

- We are dedicated to connecting Muslims worldwide through - meaningful conversations, authentic knowledge, and a supportive - community. DeenBridge empowers users to learn, share, and grow in - their faith by providing access to trusted resources, inspiring - books, and opportunities to engage with others on their journey of - Islamic excellence. + {t("description")}

@@ -35,7 +31,7 @@ const About = () => { to="/signup" className=" text-white font-semibold py-4 px-8 text-lg transition-all duration-300 transform hover:scale-105 shadow-lg hover:shadow-xl" > - Explore DeenBridge + {t("cta")}
@@ -45,7 +41,7 @@ const About = () => {
Beautiful mosque architecture representing Islamic excellence {
{/* Decorative Elements */} -
-
+
+
diff --git a/app/(pages)/(landingPage)/CTA.jsx b/app/[locale]/(pages)/(landingPage)/CTA.jsx similarity index 78% rename from app/(pages)/(landingPage)/CTA.jsx rename to app/[locale]/(pages)/(landingPage)/CTA.jsx index 166ff62b..b3e7b66d 100644 --- a/app/(pages)/(landingPage)/CTA.jsx +++ b/app/[locale]/(pages)/(landingPage)/CTA.jsx @@ -1,19 +1,20 @@ import Button from "@/components/atoms/form/Button"; import Link from "next/link"; +import { useTranslations } from "next-intl"; export default function CTA() { + const t = useTranslations("landing.cta"); return (

- Ready to Join Deen Bridge? + {t("title")}

- Unlock a world of knowledge, community, and growth. Sign up now and - start your journey with us today! + {t("description")}

diff --git a/app/(pages)/(landingPage)/Footer.jsx b/app/[locale]/(pages)/(landingPage)/Footer.jsx similarity index 72% rename from app/(pages)/(landingPage)/Footer.jsx rename to app/[locale]/(pages)/(landingPage)/Footer.jsx index 79318918..297d1158 100644 --- a/app/(pages)/(landingPage)/Footer.jsx +++ b/app/[locale]/(pages)/(landingPage)/Footer.jsx @@ -2,7 +2,17 @@ import { FaTwitter, FaGithub } from "react-icons/fa"; import { cn } from "@/lib/utils"; import { poppins_600 } from "@/lib/config/font.config"; import Link from "next/link"; +import { useTranslations } from "next-intl"; export default function Footer() { + const t = useTranslations("landing.footer"); + const links = [ + { name: t("courses"), href: "/dashboard/courses" }, + { name: t("library"), href: "/dashboard/library" }, + { name: t("spaces"), href: "/dashboard/spaces" }, + { name: t("sadaqah"), href: "/dashboard/sadaqah" }, + { name: t("blog"), href: "/blog" }, + { name: t("github"), href: "https://github.com/Deen-Bridge" }, + ]; return (