translation bug fixed

This commit is contained in:
nabijonovdavronbek619@gmail.com
2025-11-29 13:48:55 +05:00
parent ca8369cc31
commit aa2260f212
28 changed files with 1521 additions and 242 deletions

View File

@@ -3,8 +3,8 @@
import Image from "next/image";
import { motion } from "framer-motion";
import { ExternalLink } from "lucide-react";
import { useTranslations } from "next-intl";
import type { Product } from "@/lib/products";
import { useLanguage } from "@/context/language-context";
interface ProductCardProps {
product: Product;
@@ -12,8 +12,7 @@ interface ProductCardProps {
}
export function ProductCard({ product, onViewDetails }: ProductCardProps) {
const t = useTranslations();
const {t} = useLanguage();
return (
<motion.div
whileHover={{ y: -8 }}
@@ -23,7 +22,7 @@ export function ProductCard({ product, onViewDetails }: ProductCardProps) {
<div className="relative h-48 bg-gray-100 overflow-hidden group">
<Image
src={product.images[0]}
alt={t(product.nameKey)}
alt={product.nameKey}
fill
className="object-cover group-hover:scale-110 transition-transform duration-300"
/>
@@ -33,10 +32,10 @@ export function ProductCard({ product, onViewDetails }: ProductCardProps) {
{/* Content */}
<div className="p-6">
<h3 className="text-xl font-bold text-gray-900 mb-2">
{t(product.nameKey)}
{product.nameKey}
</h3>
<p className="text-gray-600 text-sm mb-4">
{t(product.shortDescriptionKey)}
{product.shortDescriptionKey}
</p>
{/* Specs Preview */}
@@ -56,7 +55,7 @@ export function ProductCard({ product, onViewDetails }: ProductCardProps) {
onClick={() => onViewDetails(product.slug)}
className="w-full flex items-center justify-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg font-medium hover:bg-blue-700 transition-colors"
>
{t("products.viewDetails")}
Batafsil
<ExternalLink size={16} />
</motion.button>
</div>