From bc3ae98540f75491186c41faa768a8e7d2d22e76 Mon Sep 17 00:00:00 2001 From: Maigo Erit Date: Tue, 4 Mar 2025 19:28:03 +0200 Subject: [PATCH 01/15] Add comprehensive homepage components with Lottie animations - Created multiple new components for homepage sections (Hero, Benefits, Pricing, etc.) - Added Lottie animation components for each section with dynamic rendering - Implemented ScrollToAnchorOnPageLoad utility component - Organized components and animations in app/[locale]/components directory - Integrated various UI elements like Carousel, IntroCallCard, and PriceItem --- app/{ => [locale]}/components/Benefits.tsx | 0 app/{ => [locale]}/components/Carousel.tsx | 0 app/{ => [locale]}/components/ComparePricing.tsx | 0 app/{ => [locale]}/components/Discuss.tsx | 0 app/{ => [locale]}/components/Faq.tsx | 0 app/{ => [locale]}/components/GridBackground.tsx | 0 app/{ => [locale]}/components/Hero.tsx | 0 app/{ => [locale]}/components/IntroCallCard.tsx | 0 app/{ => [locale]}/components/PauseTry.tsx | 0 app/{ => [locale]}/components/PriceForOthers.tsx | 0 app/{ => [locale]}/components/PriceItem.tsx | 0 app/{ => [locale]}/components/PriceItemButton.tsx | 0 app/{ => [locale]}/components/Pricing.tsx | 0 app/{ => [locale]}/components/ScollToAnchorOnPageLoad.tsx | 0 app/{ => [locale]}/components/TechScroll.tsx | 0 app/{ => [locale]}/components/TechScrollingLogos.tsx | 0 app/{ => [locale]}/components/Testimonials.tsx | 0 .../components/animations/Abstract-Waves-Circles2.json | 0 app/{ => [locale]}/components/animations/AbstractBg.tsx | 0 app/{ => [locale]}/components/animations/AdaptiveInterface.tsx | 0 app/{ => [locale]}/components/animations/BusinessAgreement.tsx | 0 app/{ => [locale]}/components/animations/BusinessValue.tsx | 0 app/{ => [locale]}/components/animations/CommunicationImage.tsx | 0 app/{ => [locale]}/components/animations/CompanyImage.tsx | 0 app/{ => [locale]}/components/animations/CustomerAssistance.tsx | 0 .../components/animations/CustomerReceivingEmail.tsx | 0 .../components/animations/DedicatedMaintananceImage.tsx | 0 .../components/animations/DeveloperCommunications.tsx | 0 app/{ => [locale]}/components/animations/DiscussImage.tsx | 0 app/{ => [locale]}/components/animations/EmployeeImage.tsx | 0 app/{ => [locale]}/components/animations/HeroImage.tsx | 0 app/{ => [locale]}/components/animations/ManWorking.tsx | 0 app/{ => [locale]}/components/animations/MoneyValueImage.tsx | 0 app/{ => [locale]}/components/animations/OnlineVideoChatting.tsx | 0 app/{ => [locale]}/components/animations/PricingImage.tsx | 0 app/{ => [locale]}/components/animations/Questions.tsx | 0 app/{ => [locale]}/components/animations/TurnaroundImage.tsx | 0 app/{ => [locale]}/components/animations/UpgradeImage.tsx | 0 app/{ => [locale]}/components/animations/WebDevelopment.tsx | 0 app/{ => [locale]}/components/animations/WorkingHome.tsx | 0 app/{ => [locale]}/components/animations/adaptive-interface.json | 0 app/{ => [locale]}/components/animations/business-agreement.json | 0 app/{ => [locale]}/components/animations/business-value.json | 0 app/{ => [locale]}/components/animations/communication.json | 0 app/{ => [locale]}/components/animations/company.json | 0 app/{ => [locale]}/components/animations/customer-assistance.json | 0 .../components/animations/customer-receiving-email2.json | 0 .../components/animations/dedicated-maintenance.json | 0 .../components/animations/developer-communications.json | 0 app/{ => [locale]}/components/animations/discuss.json | 0 app/{ => [locale]}/components/animations/employee.json | 0 .../components/animations/financial-innovation.json | 0 app/{ => [locale]}/components/animations/hero-animation.json | 0 app/{ => [locale]}/components/animations/man-working.json | 0 app/{ => [locale]}/components/animations/money-value.json | 0 .../components/animations/online-video-chatting.json | 0 app/{ => [locale]}/components/animations/pricing.json | 0 app/{ => [locale]}/components/animations/questions.json | 0 app/{ => [locale]}/components/animations/turnaround.json | 0 app/{ => [locale]}/components/animations/upgrade.json | 0 app/{ => [locale]}/components/animations/web-development.json | 0 app/{ => [locale]}/components/animations/working-home.json | 0 app/{ => [locale]}/layout.tsx | 0 app/{ => [locale]}/page.tsx | 0 64 files changed, 0 insertions(+), 0 deletions(-) rename app/{ => [locale]}/components/Benefits.tsx (100%) rename app/{ => [locale]}/components/Carousel.tsx (100%) rename app/{ => [locale]}/components/ComparePricing.tsx (100%) rename app/{ => [locale]}/components/Discuss.tsx (100%) rename app/{ => [locale]}/components/Faq.tsx (100%) rename app/{ => [locale]}/components/GridBackground.tsx (100%) rename app/{ => [locale]}/components/Hero.tsx (100%) rename app/{ => [locale]}/components/IntroCallCard.tsx (100%) rename app/{ => [locale]}/components/PauseTry.tsx (100%) rename app/{ => [locale]}/components/PriceForOthers.tsx (100%) rename app/{ => [locale]}/components/PriceItem.tsx (100%) rename app/{ => [locale]}/components/PriceItemButton.tsx (100%) rename app/{ => [locale]}/components/Pricing.tsx (100%) rename app/{ => [locale]}/components/ScollToAnchorOnPageLoad.tsx (100%) rename app/{ => [locale]}/components/TechScroll.tsx (100%) rename app/{ => [locale]}/components/TechScrollingLogos.tsx (100%) rename app/{ => [locale]}/components/Testimonials.tsx (100%) rename app/{ => [locale]}/components/animations/Abstract-Waves-Circles2.json (100%) rename app/{ => [locale]}/components/animations/AbstractBg.tsx (100%) rename app/{ => [locale]}/components/animations/AdaptiveInterface.tsx (100%) rename app/{ => [locale]}/components/animations/BusinessAgreement.tsx (100%) rename app/{ => [locale]}/components/animations/BusinessValue.tsx (100%) rename app/{ => [locale]}/components/animations/CommunicationImage.tsx (100%) rename app/{ => [locale]}/components/animations/CompanyImage.tsx (100%) rename app/{ => [locale]}/components/animations/CustomerAssistance.tsx (100%) rename app/{ => [locale]}/components/animations/CustomerReceivingEmail.tsx (100%) rename app/{ => [locale]}/components/animations/DedicatedMaintananceImage.tsx (100%) rename app/{ => [locale]}/components/animations/DeveloperCommunications.tsx (100%) rename app/{ => [locale]}/components/animations/DiscussImage.tsx (100%) rename app/{ => [locale]}/components/animations/EmployeeImage.tsx (100%) rename app/{ => [locale]}/components/animations/HeroImage.tsx (100%) rename app/{ => [locale]}/components/animations/ManWorking.tsx (100%) rename app/{ => [locale]}/components/animations/MoneyValueImage.tsx (100%) rename app/{ => [locale]}/components/animations/OnlineVideoChatting.tsx (100%) rename app/{ => [locale]}/components/animations/PricingImage.tsx (100%) rename app/{ => [locale]}/components/animations/Questions.tsx (100%) rename app/{ => [locale]}/components/animations/TurnaroundImage.tsx (100%) rename app/{ => [locale]}/components/animations/UpgradeImage.tsx (100%) rename app/{ => [locale]}/components/animations/WebDevelopment.tsx (100%) rename app/{ => [locale]}/components/animations/WorkingHome.tsx (100%) rename app/{ => [locale]}/components/animations/adaptive-interface.json (100%) rename app/{ => [locale]}/components/animations/business-agreement.json (100%) rename app/{ => [locale]}/components/animations/business-value.json (100%) rename app/{ => [locale]}/components/animations/communication.json (100%) rename app/{ => [locale]}/components/animations/company.json (100%) rename app/{ => [locale]}/components/animations/customer-assistance.json (100%) rename app/{ => [locale]}/components/animations/customer-receiving-email2.json (100%) rename app/{ => [locale]}/components/animations/dedicated-maintenance.json (100%) rename app/{ => [locale]}/components/animations/developer-communications.json (100%) rename app/{ => [locale]}/components/animations/discuss.json (100%) rename app/{ => [locale]}/components/animations/employee.json (100%) rename app/{ => [locale]}/components/animations/financial-innovation.json (100%) rename app/{ => [locale]}/components/animations/hero-animation.json (100%) rename app/{ => [locale]}/components/animations/man-working.json (100%) rename app/{ => [locale]}/components/animations/money-value.json (100%) rename app/{ => [locale]}/components/animations/online-video-chatting.json (100%) rename app/{ => [locale]}/components/animations/pricing.json (100%) rename app/{ => [locale]}/components/animations/questions.json (100%) rename app/{ => [locale]}/components/animations/turnaround.json (100%) rename app/{ => [locale]}/components/animations/upgrade.json (100%) rename app/{ => [locale]}/components/animations/web-development.json (100%) rename app/{ => [locale]}/components/animations/working-home.json (100%) rename app/{ => [locale]}/layout.tsx (100%) rename app/{ => [locale]}/page.tsx (100%) diff --git a/app/components/Benefits.tsx b/app/[locale]/components/Benefits.tsx similarity index 100% rename from app/components/Benefits.tsx rename to app/[locale]/components/Benefits.tsx diff --git a/app/components/Carousel.tsx b/app/[locale]/components/Carousel.tsx similarity index 100% rename from app/components/Carousel.tsx rename to app/[locale]/components/Carousel.tsx diff --git a/app/components/ComparePricing.tsx b/app/[locale]/components/ComparePricing.tsx similarity index 100% rename from app/components/ComparePricing.tsx rename to app/[locale]/components/ComparePricing.tsx diff --git a/app/components/Discuss.tsx b/app/[locale]/components/Discuss.tsx similarity index 100% rename from app/components/Discuss.tsx rename to app/[locale]/components/Discuss.tsx diff --git a/app/components/Faq.tsx b/app/[locale]/components/Faq.tsx similarity index 100% rename from app/components/Faq.tsx rename to app/[locale]/components/Faq.tsx diff --git a/app/components/GridBackground.tsx b/app/[locale]/components/GridBackground.tsx similarity index 100% rename from app/components/GridBackground.tsx rename to app/[locale]/components/GridBackground.tsx diff --git a/app/components/Hero.tsx b/app/[locale]/components/Hero.tsx similarity index 100% rename from app/components/Hero.tsx rename to app/[locale]/components/Hero.tsx diff --git a/app/components/IntroCallCard.tsx b/app/[locale]/components/IntroCallCard.tsx similarity index 100% rename from app/components/IntroCallCard.tsx rename to app/[locale]/components/IntroCallCard.tsx diff --git a/app/components/PauseTry.tsx b/app/[locale]/components/PauseTry.tsx similarity index 100% rename from app/components/PauseTry.tsx rename to app/[locale]/components/PauseTry.tsx diff --git a/app/components/PriceForOthers.tsx b/app/[locale]/components/PriceForOthers.tsx similarity index 100% rename from app/components/PriceForOthers.tsx rename to app/[locale]/components/PriceForOthers.tsx diff --git a/app/components/PriceItem.tsx b/app/[locale]/components/PriceItem.tsx similarity index 100% rename from app/components/PriceItem.tsx rename to app/[locale]/components/PriceItem.tsx diff --git a/app/components/PriceItemButton.tsx b/app/[locale]/components/PriceItemButton.tsx similarity index 100% rename from app/components/PriceItemButton.tsx rename to app/[locale]/components/PriceItemButton.tsx diff --git a/app/components/Pricing.tsx b/app/[locale]/components/Pricing.tsx similarity index 100% rename from app/components/Pricing.tsx rename to app/[locale]/components/Pricing.tsx diff --git a/app/components/ScollToAnchorOnPageLoad.tsx b/app/[locale]/components/ScollToAnchorOnPageLoad.tsx similarity index 100% rename from app/components/ScollToAnchorOnPageLoad.tsx rename to app/[locale]/components/ScollToAnchorOnPageLoad.tsx diff --git a/app/components/TechScroll.tsx b/app/[locale]/components/TechScroll.tsx similarity index 100% rename from app/components/TechScroll.tsx rename to app/[locale]/components/TechScroll.tsx diff --git a/app/components/TechScrollingLogos.tsx b/app/[locale]/components/TechScrollingLogos.tsx similarity index 100% rename from app/components/TechScrollingLogos.tsx rename to app/[locale]/components/TechScrollingLogos.tsx diff --git a/app/components/Testimonials.tsx b/app/[locale]/components/Testimonials.tsx similarity index 100% rename from app/components/Testimonials.tsx rename to app/[locale]/components/Testimonials.tsx diff --git a/app/components/animations/Abstract-Waves-Circles2.json b/app/[locale]/components/animations/Abstract-Waves-Circles2.json similarity index 100% rename from app/components/animations/Abstract-Waves-Circles2.json rename to app/[locale]/components/animations/Abstract-Waves-Circles2.json diff --git a/app/components/animations/AbstractBg.tsx b/app/[locale]/components/animations/AbstractBg.tsx similarity index 100% rename from app/components/animations/AbstractBg.tsx rename to app/[locale]/components/animations/AbstractBg.tsx diff --git a/app/components/animations/AdaptiveInterface.tsx b/app/[locale]/components/animations/AdaptiveInterface.tsx similarity index 100% rename from app/components/animations/AdaptiveInterface.tsx rename to app/[locale]/components/animations/AdaptiveInterface.tsx diff --git a/app/components/animations/BusinessAgreement.tsx b/app/[locale]/components/animations/BusinessAgreement.tsx similarity index 100% rename from app/components/animations/BusinessAgreement.tsx rename to app/[locale]/components/animations/BusinessAgreement.tsx diff --git a/app/components/animations/BusinessValue.tsx b/app/[locale]/components/animations/BusinessValue.tsx similarity index 100% rename from app/components/animations/BusinessValue.tsx rename to app/[locale]/components/animations/BusinessValue.tsx diff --git a/app/components/animations/CommunicationImage.tsx b/app/[locale]/components/animations/CommunicationImage.tsx similarity index 100% rename from app/components/animations/CommunicationImage.tsx rename to app/[locale]/components/animations/CommunicationImage.tsx diff --git a/app/components/animations/CompanyImage.tsx b/app/[locale]/components/animations/CompanyImage.tsx similarity index 100% rename from app/components/animations/CompanyImage.tsx rename to app/[locale]/components/animations/CompanyImage.tsx diff --git a/app/components/animations/CustomerAssistance.tsx b/app/[locale]/components/animations/CustomerAssistance.tsx similarity index 100% rename from app/components/animations/CustomerAssistance.tsx rename to app/[locale]/components/animations/CustomerAssistance.tsx diff --git a/app/components/animations/CustomerReceivingEmail.tsx b/app/[locale]/components/animations/CustomerReceivingEmail.tsx similarity index 100% rename from app/components/animations/CustomerReceivingEmail.tsx rename to app/[locale]/components/animations/CustomerReceivingEmail.tsx diff --git a/app/components/animations/DedicatedMaintananceImage.tsx b/app/[locale]/components/animations/DedicatedMaintananceImage.tsx similarity index 100% rename from app/components/animations/DedicatedMaintananceImage.tsx rename to app/[locale]/components/animations/DedicatedMaintananceImage.tsx diff --git a/app/components/animations/DeveloperCommunications.tsx b/app/[locale]/components/animations/DeveloperCommunications.tsx similarity index 100% rename from app/components/animations/DeveloperCommunications.tsx rename to app/[locale]/components/animations/DeveloperCommunications.tsx diff --git a/app/components/animations/DiscussImage.tsx b/app/[locale]/components/animations/DiscussImage.tsx similarity index 100% rename from app/components/animations/DiscussImage.tsx rename to app/[locale]/components/animations/DiscussImage.tsx diff --git a/app/components/animations/EmployeeImage.tsx b/app/[locale]/components/animations/EmployeeImage.tsx similarity index 100% rename from app/components/animations/EmployeeImage.tsx rename to app/[locale]/components/animations/EmployeeImage.tsx diff --git a/app/components/animations/HeroImage.tsx b/app/[locale]/components/animations/HeroImage.tsx similarity index 100% rename from app/components/animations/HeroImage.tsx rename to app/[locale]/components/animations/HeroImage.tsx diff --git a/app/components/animations/ManWorking.tsx b/app/[locale]/components/animations/ManWorking.tsx similarity index 100% rename from app/components/animations/ManWorking.tsx rename to app/[locale]/components/animations/ManWorking.tsx diff --git a/app/components/animations/MoneyValueImage.tsx b/app/[locale]/components/animations/MoneyValueImage.tsx similarity index 100% rename from app/components/animations/MoneyValueImage.tsx rename to app/[locale]/components/animations/MoneyValueImage.tsx diff --git a/app/components/animations/OnlineVideoChatting.tsx b/app/[locale]/components/animations/OnlineVideoChatting.tsx similarity index 100% rename from app/components/animations/OnlineVideoChatting.tsx rename to app/[locale]/components/animations/OnlineVideoChatting.tsx diff --git a/app/components/animations/PricingImage.tsx b/app/[locale]/components/animations/PricingImage.tsx similarity index 100% rename from app/components/animations/PricingImage.tsx rename to app/[locale]/components/animations/PricingImage.tsx diff --git a/app/components/animations/Questions.tsx b/app/[locale]/components/animations/Questions.tsx similarity index 100% rename from app/components/animations/Questions.tsx rename to app/[locale]/components/animations/Questions.tsx diff --git a/app/components/animations/TurnaroundImage.tsx b/app/[locale]/components/animations/TurnaroundImage.tsx similarity index 100% rename from app/components/animations/TurnaroundImage.tsx rename to app/[locale]/components/animations/TurnaroundImage.tsx diff --git a/app/components/animations/UpgradeImage.tsx b/app/[locale]/components/animations/UpgradeImage.tsx similarity index 100% rename from app/components/animations/UpgradeImage.tsx rename to app/[locale]/components/animations/UpgradeImage.tsx diff --git a/app/components/animations/WebDevelopment.tsx b/app/[locale]/components/animations/WebDevelopment.tsx similarity index 100% rename from app/components/animations/WebDevelopment.tsx rename to app/[locale]/components/animations/WebDevelopment.tsx diff --git a/app/components/animations/WorkingHome.tsx b/app/[locale]/components/animations/WorkingHome.tsx similarity index 100% rename from app/components/animations/WorkingHome.tsx rename to app/[locale]/components/animations/WorkingHome.tsx diff --git a/app/components/animations/adaptive-interface.json b/app/[locale]/components/animations/adaptive-interface.json similarity index 100% rename from app/components/animations/adaptive-interface.json rename to app/[locale]/components/animations/adaptive-interface.json diff --git a/app/components/animations/business-agreement.json b/app/[locale]/components/animations/business-agreement.json similarity index 100% rename from app/components/animations/business-agreement.json rename to app/[locale]/components/animations/business-agreement.json diff --git a/app/components/animations/business-value.json b/app/[locale]/components/animations/business-value.json similarity index 100% rename from app/components/animations/business-value.json rename to app/[locale]/components/animations/business-value.json diff --git a/app/components/animations/communication.json b/app/[locale]/components/animations/communication.json similarity index 100% rename from app/components/animations/communication.json rename to app/[locale]/components/animations/communication.json diff --git a/app/components/animations/company.json b/app/[locale]/components/animations/company.json similarity index 100% rename from app/components/animations/company.json rename to app/[locale]/components/animations/company.json diff --git a/app/components/animations/customer-assistance.json b/app/[locale]/components/animations/customer-assistance.json similarity index 100% rename from app/components/animations/customer-assistance.json rename to app/[locale]/components/animations/customer-assistance.json diff --git a/app/components/animations/customer-receiving-email2.json b/app/[locale]/components/animations/customer-receiving-email2.json similarity index 100% rename from app/components/animations/customer-receiving-email2.json rename to app/[locale]/components/animations/customer-receiving-email2.json diff --git a/app/components/animations/dedicated-maintenance.json b/app/[locale]/components/animations/dedicated-maintenance.json similarity index 100% rename from app/components/animations/dedicated-maintenance.json rename to app/[locale]/components/animations/dedicated-maintenance.json diff --git a/app/components/animations/developer-communications.json b/app/[locale]/components/animations/developer-communications.json similarity index 100% rename from app/components/animations/developer-communications.json rename to app/[locale]/components/animations/developer-communications.json diff --git a/app/components/animations/discuss.json b/app/[locale]/components/animations/discuss.json similarity index 100% rename from app/components/animations/discuss.json rename to app/[locale]/components/animations/discuss.json diff --git a/app/components/animations/employee.json b/app/[locale]/components/animations/employee.json similarity index 100% rename from app/components/animations/employee.json rename to app/[locale]/components/animations/employee.json diff --git a/app/components/animations/financial-innovation.json b/app/[locale]/components/animations/financial-innovation.json similarity index 100% rename from app/components/animations/financial-innovation.json rename to app/[locale]/components/animations/financial-innovation.json diff --git a/app/components/animations/hero-animation.json b/app/[locale]/components/animations/hero-animation.json similarity index 100% rename from app/components/animations/hero-animation.json rename to app/[locale]/components/animations/hero-animation.json diff --git a/app/components/animations/man-working.json b/app/[locale]/components/animations/man-working.json similarity index 100% rename from app/components/animations/man-working.json rename to app/[locale]/components/animations/man-working.json diff --git a/app/components/animations/money-value.json b/app/[locale]/components/animations/money-value.json similarity index 100% rename from app/components/animations/money-value.json rename to app/[locale]/components/animations/money-value.json diff --git a/app/components/animations/online-video-chatting.json b/app/[locale]/components/animations/online-video-chatting.json similarity index 100% rename from app/components/animations/online-video-chatting.json rename to app/[locale]/components/animations/online-video-chatting.json diff --git a/app/components/animations/pricing.json b/app/[locale]/components/animations/pricing.json similarity index 100% rename from app/components/animations/pricing.json rename to app/[locale]/components/animations/pricing.json diff --git a/app/components/animations/questions.json b/app/[locale]/components/animations/questions.json similarity index 100% rename from app/components/animations/questions.json rename to app/[locale]/components/animations/questions.json diff --git a/app/components/animations/turnaround.json b/app/[locale]/components/animations/turnaround.json similarity index 100% rename from app/components/animations/turnaround.json rename to app/[locale]/components/animations/turnaround.json diff --git a/app/components/animations/upgrade.json b/app/[locale]/components/animations/upgrade.json similarity index 100% rename from app/components/animations/upgrade.json rename to app/[locale]/components/animations/upgrade.json diff --git a/app/components/animations/web-development.json b/app/[locale]/components/animations/web-development.json similarity index 100% rename from app/components/animations/web-development.json rename to app/[locale]/components/animations/web-development.json diff --git a/app/components/animations/working-home.json b/app/[locale]/components/animations/working-home.json similarity index 100% rename from app/components/animations/working-home.json rename to app/[locale]/components/animations/working-home.json diff --git a/app/layout.tsx b/app/[locale]/layout.tsx similarity index 100% rename from app/layout.tsx rename to app/[locale]/layout.tsx diff --git a/app/page.tsx b/app/[locale]/page.tsx similarity index 100% rename from app/page.tsx rename to app/[locale]/page.tsx From 9d305b3b608b4f34699677cab3beaf1fd5c6357e Mon Sep 17 00:00:00 2001 From: Maigo Erit Date: Tue, 4 Mar 2025 21:22:51 +0200 Subject: [PATCH 02/15] Add internationalization (i18n) support with next-intl - Integrate next-intl for multi-language support - Configure routing and middleware for locales (en, et) - Add language switcher component - Create message files for English and Estonian - Update layout and components to support internationalization - Add global type definitions for internationalization - Implement locale-based routing and navigation --- app/[locale]/layout.tsx | 53 +++++++++++----- app/[locale]/page.tsx | 20 +++--- app/layout.tsx | 11 ++++ app/not-found.tsx | 17 ++++++ components/Header/HeaderNavbar.tsx | 11 +++- components/Header/MenuDialog.tsx | 14 ++++- components/LanguageSwitcher.tsx | 37 ++++++++++++ components/theme/ThemeProvider.tsx | 2 +- global.d.ts | 10 +++ i18n/request.ts | 19 ++++++ i18n/routing.ts | 14 +++++ i18n/settings.ts | 3 + messages/en/page.json | 9 +++ messages/et/page.json | 9 +++ middleware.ts | 23 ++++--- next.config.js | 8 +++ package.json | 1 + pnpm-lock.yaml | 97 ++++++++++++++++++++++++++++++ 18 files changed, 318 insertions(+), 40 deletions(-) create mode 100644 app/layout.tsx create mode 100644 app/not-found.tsx create mode 100644 components/LanguageSwitcher.tsx create mode 100644 global.d.ts create mode 100644 i18n/request.ts create mode 100644 i18n/routing.ts create mode 100644 i18n/settings.ts create mode 100644 messages/en/page.json create mode 100644 messages/et/page.json create mode 100644 next.config.js diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index 46e001e..a26d44c 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from 'next'; import Head from 'next/head'; import { getURL } from '@/utils/helpers'; -import { PropsWithChildren, Suspense } from 'react'; +import { Suspense } from 'react'; import { ThemeProvider } from '@/components/theme/ThemeProvider'; @@ -11,9 +11,14 @@ import { Box } from '@chakra-ui/react'; import { Footer } from '@/components/Header/Footer'; import { HeaderNavbar } from '@/components/Header/HeaderNavbar'; +import { routing } from '@/i18n/routing'; import { Analytics } from '@vercel/analytics/react'; import { SpeedInsights } from '@vercel/speed-insights/next'; +import { NextIntlClientProvider } from 'next-intl'; +import { getMessages, setRequestLocale } from 'next-intl/server'; import { M_PLUS_Rounded_1c, Roboto } from 'next/font/google'; +import { notFound } from 'next/navigation'; +import type { ReactNode } from 'react'; const roboto = Roboto({ weight: ['400', '500', '700'], @@ -101,7 +106,25 @@ export async function generateMetadata(): Promise { }; } -export default async function RootLayout({ children }: PropsWithChildren) { +type Props = { + children: ReactNode; + params: Promise<{ locale: string }>; +}; + +export default async function LocaleLayout({ children, params }: Props) { + const { locale } = await params; + + // Ensure that the incoming `locale` is valid + if (!routing.locales.includes(locale as any)) { + notFound(); + } + + // Enable static rendering + setRequestLocale(locale); + + // Providing all messages to the client + // side is the easiest way to get started + const messages = await getMessages(); return ( <> @@ -109,23 +132,25 @@ export default async function RootLayout({ children }: PropsWithChildren) { - + - - - - + + + + + - {children} + {children} -