diff --git a/components/layout/navbar.tsx b/components/layout/navbar.tsx index 6df820a..c833e62 100644 --- a/components/layout/navbar.tsx +++ b/components/layout/navbar.tsx @@ -69,7 +69,7 @@ export function Navbar() { href={`/${locale}/faq`} className="font-unbounded uppercase text-white text-sm h-full flex items-center font-semibold hover:cursor-pointer hover:text-red-500 transition" > - {t("navbar.faq")} + {locale === "ru" ? "ФАК" : "FAQ"} setIsMobileMenuOpen(false)} > - {t("navbar.faq")} + {locale === "ru" ? "ФАК" : "FAQ"} state.subCategory); const setSubCategory = useSubCategory((state) => state.setSubCategory); const clearSubCategory = useSubCategory((state) => state.clearSubCategory); + const t = useTranslations(); const [dataExpanded, setDataExpanded] = useState(false); const [numberExpanded, setNumberExpanded] = useState(false); @@ -211,7 +213,7 @@ export default function Filter() { )) ) : (

- SubCategory topilmadi + {t("subcategory_not_found")}

)} @@ -225,7 +227,7 @@ export default function Filter() { {visibleSectionData && visibleSectionData.length > 0 && (

- Bo'lim + {t("section")}

{visibleSectionData.map((item: any) => ( diff --git a/components/pages/products/filter/filterInfo.tsx b/components/pages/products/filter/filterInfo.tsx index 4215df9..e1e4bbb 100644 --- a/components/pages/products/filter/filterInfo.tsx +++ b/components/pages/products/filter/filterInfo.tsx @@ -2,17 +2,18 @@ import { useFilter } from "@/lib/filter-zustand"; import { X } from "lucide-react"; +import { useTranslations } from "next-intl"; export default function FilterInfo() { const filtered = useFilter((state) => state.filter); const resetFilter = useFilter((state) => state.resetFilter); const togleFilter = useFilter((state) => state.toggleFilter); + const t = useTranslations(); if (filtered.length === 0) { return null; } return (
-

Found: 20

{filtered && filtered.map((item) => ( @@ -28,7 +29,7 @@ export default function FilterInfo() { ))}
); diff --git a/components/pages/products/slug/slider.tsx b/components/pages/products/slug/slider.tsx index 349621c..fefe084 100644 --- a/components/pages/products/slug/slider.tsx +++ b/components/pages/products/slug/slider.tsx @@ -8,12 +8,14 @@ import "swiper/css/navigation"; import "swiper/css/pagination"; import "swiper/css/thumbs"; import Image from "next/image"; +import { useTranslations } from "next-intl"; const navigationPrevEl = ".custom-swiper-prev"; const navigationNextEl = ".custom-swiper-next"; export function SliderComp({ imgs }: { imgs: string[] }) { const [thumbsSwiper, setThumbsSwiper] = useState(null); + const t = useTranslations(); // Agar rasm bo'lmasa if (!imgs || imgs.length === 0) { @@ -33,7 +35,7 @@ export function SliderComp({ imgs }: { imgs: string[] }) { d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" /> -

Rasm mavjud emas

+

{t("image_not_found")}

); @@ -45,7 +47,10 @@ export function SliderComp({ imgs }: { imgs: string[] }) {
- - + + @@ -130,4 +155,4 @@ export function SliderComp({ imgs }: { imgs: string[] }) { )}
); -} \ No newline at end of file +} diff --git a/components/pages/services/serviceFaq.tsx b/components/pages/services/serviceFaq.tsx index b6bec07..474b86e 100644 --- a/components/pages/services/serviceFaq.tsx +++ b/components/pages/services/serviceFaq.tsx @@ -1,53 +1,54 @@ import DotAnimatsiya from "@/components/dot/DotAnimatsiya"; -import FAQAccordion from "../faq/faqAccardion"; -import { useTranslations } from "next-intl"; +import FAQAccordion, { FAQItem } from "../faq/faqAccardion"; +import { useLocale, useTranslations } from "next-intl"; export function ServiceFaq() { const t = useTranslations(); - const faqItems = [ - { - id: "faq-1", - question: t("faq.question1.question"), - answer: t("faq.question1.answer"), - }, - { - id: "faq-2", - question: t("faq.question2.question"), - answer: t("faq.question2.answer"), - }, - { - id: "faq-3", - question: t("faq.question3.question"), - answer: t("faq.question3.answer"), - }, - { - id: "faq-4", - question: t("faq.question4.question"), - answer: t("faq.question4.answer"), - }, - { - id: "faq-5", - question: t("faq.question5.question"), - answer: t("faq.question5.answer"), - }, - ]; + const locale = useLocale(); + const faqItems: FAQItem[] = [ + { + id: 1, + question: t("faq.question1.question"), + answer: t("faq.question1.answer"), + }, + { + id: 2, + question: t("faq.question2.question"), + answer: t("faq.question2.answer"), + }, + { + id: 3, + question: t("faq.question3.question"), + answer: t("faq.question3.answer"), + }, + { + id: 4, + question: t("faq.question4.question"), + answer: t("faq.question4.answer"), + }, + { + id: 5, + question: t("faq.question5.question"), + answer: t("faq.question5.answer"), + }, + ]; return (
{/* header */}
- FAQ + {locale === "ru" ? "ФАК" : "FAQ"}

- General Questions + {t("faq.banner.topic")}

{/* FAQ Section */} -
+
diff --git a/components/pages/subCategory/body.tsx b/components/pages/subCategory/body.tsx index 1db426e..afecde6 100644 --- a/components/pages/subCategory/body.tsx +++ b/components/pages/subCategory/body.tsx @@ -5,9 +5,11 @@ import { endPoints } from "@/request/links"; import { useQuery } from "@tanstack/react-query"; import { useCategory } from "@/store/useCategory"; import Card from "./card"; +import { useTranslations } from "next-intl"; export function MainSubCategory() { const category = useCategory((state) => state.category); + const t = useTranslations(); const { data, isLoading, error } = useQuery({ queryKey: ["subCategory"], queryFn: () => httpClient(endPoints.subCategory.byId(category.id)), @@ -27,7 +29,7 @@ export function MainSubCategory() { if (error) { return (
- Ma'lumotlarni yuklashda xatolik yuz berdi + {t("loading_error")}
); } @@ -35,7 +37,7 @@ export function MainSubCategory() { if (!data || data.length === 0) { return (
- Mahsulotlar topilmadi + {t("products_not_found")}
); } @@ -43,7 +45,7 @@ export function MainSubCategory() {
{data.map((item: any) => (