From bca33a9d7434b8a4d5454166aeb83495447fd3da Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 10 Jun 2026 20:57:29 +0000 Subject: [PATCH 1/7] Add src/app/[locale]/layout.tsx --- src/app/[locale]/layout.tsx | 72 +++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/app/[locale]/layout.tsx diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx new file mode 100644 index 0000000..981388d --- /dev/null +++ b/src/app/[locale]/layout.tsx @@ -0,0 +1,72 @@ +"use client"; + +import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import ReactLenis from "lenis/react"; +import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline'; +import ProductCart from '@/components/ecommerce/cart/ProductCart'; +import { useParams } from 'next/navigation'; +import { LanguageSwitcher } from '@/components/LanguageSwitcher'; +import { Locale } from '@/lib/i18nConfig'; + +export default function LocaleLayout({ + children, +}: Readonly<{ children: React.ReactNode }>) +{ + const params = useParams(); + const locale = params.locale as Locale; + + return ( + + + + {children} + {/* The ProductCart is a global component, typically rendered within a layout. Moved here. */} +
+ {}} + items={[ + { + id: "item1", name: "Sample Product", price: "99.99", quantity: 1, + imageSrc: "http://img.b2bpic.net/free-photo/modern-equipped-computer-lab_23-2149241207.jpg", imageAlt: "Sample Product Image" + } + ]} + total="99.99" + buttons={[ + { text: "Checkout", onClick: () => console.log("Checkout clicked") } + ]} + /> +
+
+
+ ); +} From e9828f88599a72e02cf6877bb29a99f19d04ced7 Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 10 Jun 2026 20:57:30 +0000 Subject: [PATCH 2/7] Add src/app/[locale]/page.tsx --- src/app/[locale]/page.tsx | 74 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 src/app/[locale]/page.tsx diff --git a/src/app/[locale]/page.tsx b/src/app/[locale]/page.tsx new file mode 100644 index 0000000..2d87793 --- /dev/null +++ b/src/app/[locale]/page.tsx @@ -0,0 +1,74 @@ +"use client"; + +import SplitAbout from '@/components/sections/about/SplitAbout'; +import ProductCardThree from '@/components/sections/product/ProductCardThree'; +import TeamCardTwo from '@/components/sections/team/TeamCardTwo'; +import TestimonialCardFifteen from '@/components/sections/testimonial/TestimonialCardFifteen'; + +export default function LocalizedLandingPage() { + return ( + <> +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + ); +} From 22bd622a46ed8fb87db309d6b0e27324d82959df Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 10 Jun 2026 20:57:30 +0000 Subject: [PATCH 3/7] Update src/app/layout.tsx --- src/app/layout.tsx | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index a8f719e..946d842 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,36 +1,25 @@ import type { Metadata } from "next"; -import { Halant } from "next/font/google"; -import { Inter } from "next/font/google"; +import { Public_Sans } from "next/font/google"; import "./globals.css"; import "@/lib/gsap-setup"; import { ServiceWrapper } from "@/components/ServiceWrapper"; import Tag from "@/tag/Tag"; import { getVisualEditScript } from "@/utils/visual-edit-script"; -import { Public_Sans } from "next/font/google"; - - +import { i18n } from '@/lib/i18nConfig'; // New import export const metadata: Metadata = { title: 'Enkidu Soft - Engineering Excellence', description: 'Enkidu Soft partners with enterprise leaders to architect, build, and scale transformative software solutions with rigorous engineering and deep market insight.', openGraph: { - "title": "Enkidu Soft - Engineering Excellence", - "description": "Enkidu Soft partners with enterprise leaders to architect, build, and scale transformative software solutions with rigorous engineering and deep market insight.", - "url": "https://www.enkidusoft.com/en", - "siteName": "Enkidu Soft", - "images": [ + "title": "Enkidu Soft - Engineering Excellence", "description": "Enkidu Soft partners with enterprise leaders to architect, build, and scale transformative software solutions with rigorous engineering and deep market insight.", "url": "https://www.enkidusoft.com/en", "siteName": "Enkidu Soft", "images": [ { - "url": "http://img.b2bpic.net/free-photo/geometric-abstract-background-technology-concept-connecting-dots-design_53876-153353.jpg", - "alt": "Abstract data flow and secure connections" + "url": "http://img.b2bpic.net/free-photo/geometric-abstract-background-technology-concept-connecting-dots-design_53876-153353.jpg", "alt": "Abstract data flow and secure connections" } ], "type": "website" }, twitter: { - "card": "summary_large_image", - "title": "Enkidu Soft - Engineering Excellence", - "description": "Enkidu Soft partners with enterprise leaders to architect, build, and scale transformative software solutions with rigorous engineering and deep market insight.", - "images": [ + "card": "summary_large_image", "title": "Enkidu Soft - Engineering Excellence", "description": "Enkidu Soft partners with enterprise leaders to architect, build, and scale transformative software solutions with rigorous engineering and deep market insight.", "images": [ "http://img.b2bpic.net/free-photo/geometric-abstract-background-technology-concept-connecting-dots-design_53876-153353.jpg" ] }, @@ -41,17 +30,23 @@ export const metadata: Metadata = { }; const publicSans = Public_Sans({ - variable: "--font-public-sans", - subsets: ["latin"], + variable: "--font-public-sans", subsets: ["latin"], }); +// Generate static params for all locales +export function generateStaticParams() { + return i18n.locales.map((locale) => ({ locale })); +} + export default function RootLayout({ children, + params: { locale }, // Accept locale from the URL }: Readonly<{ children: React.ReactNode; + params: { locale: string }; // Type definition for params }>) { return ( - + From 80d1b44fc35066c4c873c0627a0bd8a3a6ed760f Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 10 Jun 2026 20:57:31 +0000 Subject: [PATCH 4/7] Update src/app/page.tsx --- src/app/page.tsx | 56 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 81874d5..66f0800 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -4,10 +4,11 @@ import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import ReactLenis from "lenis/react"; import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline'; import ProductCardThree from '@/components/sections/product/ProductCardThree'; -import ProductCart from '@/components/ecommerce/cart/ProductCart'; import SplitAbout from '@/components/sections/about/SplitAbout'; import TeamCardTwo from '@/components/sections/team/TeamCardTwo'; import TestimonialCardFifteen from '@/components/sections/testimonial/TestimonialCardFifteen'; +import SocialProofOne from '@/components/sections/socialProof/SocialProofOne'; +import ContactSplitForm from '@/components/sections/contact/ContactSplitForm'; export default function LandingPage() { return ( @@ -63,14 +64,35 @@ export default function LandingPage() { /> -
+
+
+ +
+
@@ -108,19 +130,19 @@ export default function LandingPage() { />
-
- {}} - items={[ - { - id: "item1", name: "Sample Product", price: "99.99", quantity: 1, - imageSrc: "http://img.b2bpic.net/free-photo/modern-equipped-computer-lab_23-2149241207.jpg", imageAlt: "Sample Product Image"} - ]} - total="99.99" - buttons={[ - { text: "Checkout", onClick: () => console.log("Checkout clicked") } +
+
From 42ee617a67c1b6133854a9b6fe46b7906194d4d0 Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 10 Jun 2026 20:57:31 +0000 Subject: [PATCH 5/7] Add src/components/LanguageSwitcher.tsx --- src/components/LanguageSwitcher.tsx | 63 +++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/components/LanguageSwitcher.tsx diff --git a/src/components/LanguageSwitcher.tsx b/src/components/LanguageSwitcher.tsx new file mode 100644 index 0000000..8961b56 --- /dev/null +++ b/src/components/LanguageSwitcher.tsx @@ -0,0 +1,63 @@ +"use client"; + +import { useRouter, usePathname } from 'next/navigation'; +import { i18n, Locale } from '@/lib/i18nConfig'; +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select'; // Assuming shadcn-ui select component +import { useState, useEffect } from 'react'; + +// Placeholder for shadcn-ui select if not available: +// Replace with your actual UI kit's Select/Dropdown or a simple onChange(e.target.value)}> + {placeholder && } + {options.map((option) => ( + + ))} + +); +*/ + +interface LanguageSwitcherProps { + currentLocale: Locale; +} + +export function LanguageSwitcher({ currentLocale }: LanguageSwitcherProps) { + const router = useRouter(); + const pathname = usePathname(); + const [isMounted, setIsMounted] = useState(false); + + useEffect(() => { + setIsMounted(true); + }, []); + + if (!isMounted) { + return null; // Or a loading spinner + } + + const onSelectChange = (newLocale: Locale) => { + // Replace the current locale in the pathname with the new one + const newPath = `/${newLocale}${pathname.substring(3)}`; // Assuming /en, /fr, /es are 3 chars + router.push(newPath); + + // Set cookie for middleware to remember preferred locale + document.cookie = `NEXT_LOCALE=${newLocale}; path=/; max-age=31536000;`; + }; + + return ( + + ); +} From 685a4c9be9ca3351c02f52e28dc73f32adc783c9 Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 10 Jun 2026 20:57:31 +0000 Subject: [PATCH 6/7] Add src/lib/i18nConfig.ts --- src/lib/i18nConfig.ts | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/lib/i18nConfig.ts diff --git a/src/lib/i18nConfig.ts b/src/lib/i18nConfig.ts new file mode 100644 index 0000000..0a25afd --- /dev/null +++ b/src/lib/i18nConfig.ts @@ -0,0 +1,6 @@ +export const i18n = { + defaultLocale: 'en', + locales: ['en', 'fr', 'es'], // Define your supported locales +} as const; + +export type Locale = (typeof i18n)['locales'][number]; From ff7b22eaa9d5e4fdc2fdf54ca65df1b73eeef730 Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 10 Jun 2026 20:57:32 +0000 Subject: [PATCH 7/7] Add src/middleware.ts --- src/middleware.ts | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/middleware.ts diff --git a/src/middleware.ts b/src/middleware.ts new file mode 100644 index 0000000..5210f79 --- /dev/null +++ b/src/middleware.ts @@ -0,0 +1,38 @@ +import { NextRequest, NextResponse } from 'next/server'; +import { i18n } from './lib/i18nConfig'; + +const PUBLIC_FILE_REGEX = /\.(.*)$/; + +export function middleware(request: NextRequest) { + const locale = request.cookies.get('NEXT_LOCALE')?.value || i18n.defaultLocale; + const { pathname } = request.nextUrl; + + // Skip internal Next.js paths and static files + if ( + pathname.startsWith('/_next') || + pathname.startsWith('/api') || + PUBLIC_FILE_REGEX.test(pathname) + ) { + return; + } + + // Check if there is any supported locale in the pathname + const pathnameHasLocale = i18n.locales.some( + (loc) => pathname.startsWith(`/${loc}/`) || pathname === `/${loc}` + ); + + if (pathnameHasLocale) { + return NextResponse.next(); + } + + // Rewrite to include the default locale if no locale is present + request.nextUrl.pathname = `/${locale}${pathname}`; + return NextResponse.redirect(request.nextUrl); +} + +export const config = { + matcher: [ + '/((?!api|_next/static|_next/image|favicon.ico).*)', + '/', + ], +};