translation bug fixed
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
import { ReactNode } from "react";
|
||||
import { notFound } from "next/navigation";
|
||||
import { locales } from "@/i18n.config";
|
||||
|
||||
export function generateStaticParams() {
|
||||
return locales.map((locale) => ({ locale }));
|
||||
}
|
||||
|
||||
interface LocaleLayoutProps {
|
||||
children: ReactNode;
|
||||
params: Promise<{
|
||||
locale: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
async function LocaleLayout({ children, params }: LocaleLayoutProps) {
|
||||
const { locale } = await params;
|
||||
|
||||
if (!locales.includes(locale as any)) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
export default LocaleLayout;
|
||||
@@ -1,36 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { Navbar } from "@/components/Navbar";
|
||||
import { ShowCase } from "@/components/ShowCase";
|
||||
import { About } from "@/components/About";
|
||||
import { ProductsGrid } from "@/components/ProductsGrid";
|
||||
import { FAQ } from "@/components/FAQ";
|
||||
import { ContactForm } from "@/components/ContactForm";
|
||||
import { Footer } from "@/components/Footer";
|
||||
|
||||
const HERO_IMAGES = [
|
||||
"/product/product.jpg",
|
||||
"/product/product.jpg",
|
||||
"/product/product.jpg",
|
||||
"/product/product.jpg",
|
||||
"/product/product.jpg",
|
||||
];
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<main>
|
||||
<Navbar />
|
||||
<ShowCase
|
||||
titleKey="hero.title"
|
||||
subtitleKey="hero.subtitle"
|
||||
ctaLabelKey="hero.cta"
|
||||
images={HERO_IMAGES}
|
||||
/>
|
||||
<About />
|
||||
<ProductsGrid />
|
||||
<FAQ />
|
||||
<ContactForm />
|
||||
<Footer />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -1,48 +1,18 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
|
||||
|
||||
import { ReactNode } from "react";
|
||||
import { NextIntlClientProvider } from "next-intl";
|
||||
import { getMessages } from "next-intl/server";
|
||||
import "./globals.css";
|
||||
|
||||
const geistSans = Geist({
|
||||
variable: "--font-geist-sans",
|
||||
subsets: ["latin"],
|
||||
});
|
||||
|
||||
const geistMono = Geist_Mono({
|
||||
variable: "--font-geist-mono",
|
||||
subsets: ["latin"],
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Firma - Industrial Equipment & Pumps",
|
||||
description:
|
||||
"Premium industrial pumps and equipment supplier with 10+ years of experience",
|
||||
};
|
||||
|
||||
async function RootLayout({
|
||||
children,
|
||||
params,
|
||||
}: Readonly<{
|
||||
children: ReactNode;
|
||||
params: Promise<Record<string, any>>;
|
||||
}>) {
|
||||
const resolvedParams = await params;
|
||||
const locale = resolvedParams.locale || "uz";
|
||||
const messages = await getMessages();
|
||||
import "../i18n/request"; // i18n config faylini import qilamiz
|
||||
import { LanguageProvider } from "@/context/language-context";
|
||||
import './globals.css'
|
||||
|
||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<html lang={locale}>
|
||||
<body
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||
>
|
||||
<NextIntlClientProvider messages={messages}>
|
||||
<html lang="uz">
|
||||
<body>
|
||||
<LanguageProvider>
|
||||
{children}
|
||||
</NextIntlClientProvider>
|
||||
</LanguageProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
export default RootLayout;
|
||||
|
||||
31
app/page.tsx
31
app/page.tsx
@@ -1,5 +1,32 @@
|
||||
import { redirect } from "next/navigation";
|
||||
"use client";
|
||||
|
||||
import { Navbar } from "@/components/Navbar";
|
||||
import { ShowCase } from "@/components/ShowCase";
|
||||
import { About } from "@/components/About";
|
||||
import { ProductsGrid } from "@/components/ProductsGrid";
|
||||
import { FAQ } from "@/components/FAQ";
|
||||
import { ContactForm } from "@/components/ContactForm";
|
||||
import { Footer } from "@/components/Footer";
|
||||
|
||||
const HERO_IMAGES = [
|
||||
"/product/product.jpg",
|
||||
"/product/product1.jpg",
|
||||
"/product/product2.jpg",
|
||||
"/product/product3.jpg",
|
||||
];
|
||||
|
||||
export default function Home() {
|
||||
redirect('/uz')
|
||||
return (
|
||||
<main>
|
||||
<Navbar />
|
||||
<ShowCase
|
||||
images={HERO_IMAGES}
|
||||
/>
|
||||
<About />
|
||||
<ProductsGrid />
|
||||
<FAQ />
|
||||
<ContactForm />
|
||||
<Footer />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user