Set up complete bilingual (Bengali + English) support using next-intl.
1. middleware.ts:
- Default locale: 'bn' (Bengali)
- Supported locales: ['bn', 'en']
- Redirect / to /bn automatically
- Don't apply i18n to /admin/* routes
2. next.config.ts:
Configure next-intl plugin properly.
3. Translation files — create COMPLETE translations:
src/messages/bn.json (Bengali — all strings):
{
"nav": { "home", "products", "order", "about", "reviews", "orderNow" },
"hero": { "eyebrow", "title", "subtitle", "description", "exploreCta", "orderCta" },
"features": { "handwoven", "handwoven_desc", "natural", "natural_desc", "custom", "custom_desc", "delivery", "delivery_desc" },
"products": { "title", "subtitle", "allFilter", "traditional", "contemporary", "bridal", "festival", "orderBtn", "whatsappBtn", "viewAll", "noResults", "resultsCount" },
"order": { "title", "subtitle", "nameLabel", "phonelabel", "emailLabel", ... all field labels and validation messages },
"reviews": { "title", "addReview", "submitReview", "pendingApproval" },
"footer": { "description", "quickLinks", "policies", "copyright" },
"payment": { "successTitle", "successMessage", "failTitle", "failMessage", "retry" }
}
src/messages/en.json — same structure, English translations.
4. Language Switcher Component:
- Compact toggle: "বাংলা | EN"
- Switches between /bn/... and /en/...
- Preserves current path (e.g. /bn/products/dhakai → /en/products/dhakai)
- Store preference in cookie
5. Update ALL components to use useTranslations() hook:
Show me how to update the Navbar component as a reference example.
Implement complete SEO and Analytics for Adi Jamdani website.
1. Root Layout Metadata (src/app/layout.tsx):
Default metadata object:
- title template: "%s | আদি জামদানি by Shohana"
- default title: "আদি জামদানি by Shohana | Handwoven Jamdani Sarees Bangladesh"
- description: bilingual SEO description (150 chars)
- keywords: ["জামদানি শাড়ি", "Jamdani saree Bangladesh", "handwoven saree", "ঢাকাই জামদানি", "Dhakai Jamdani online", "custom Jamdani saree"]
- openGraph: site name, locale (bn_BD + en_US), type website, og:image
- twitter card
- robots: index, follow
- alternates: canonical + hreflang (bn → /bn/..., en → /en/...)
2. Per-page Metadata — show generateMetadata for:
- /products page
- /products/[slug] page (dynamic, fetch product data)
- /about page
- /order page
3. JSON-LD Structured Data — create for:
- Organization (for site-wide, in root layout)
- Product (for each product detail page — include price, availability, image)
- BreadcrumbList (for product and category pages)
- FAQPage (for FAQ page)
4. Sitemap (src/app/sitemap.ts):
- Static pages: /, /products, /about, /reviews, /order, /faq
- Dynamic product pages: fetch all active product slugs from Supabase
- Both /bn/ and /en/ versions for each page
- Include lastModified, changeFrequency, priority
5. Robots.txt (src/app/robots.ts):
- Allow all for public pages
- Disallow /admin/*
6. Google Analytics 4 (src/components/analytics/GoogleAnalytics.tsx):
- Script using next/script with afterInteractive strategy
- Track: page views, product views, order form starts, order completions
- Custom events: trackProductView(slug), trackOrderStart(), trackOrderComplete(amount)
7. Facebook Pixel (src/components/analytics/FacebookPixel.tsx):
- ViewContent event on product pages
- InitiateCheckout event on order form
- Purchase event on payment success
8. og-image (public/og-image.jpg):
- Generate a Next.js opengraph-image.tsx for the home page
- Shows brand name + tagline + brand colors