From 0a7c555549c704052e8f5edc9c268aa1019a2143 Mon Sep 17 00:00:00 2001 From: Unchained Date: Tue, 24 Mar 2026 11:46:05 +0200 Subject: [PATCH] fix: ProductDetail using wrong locale comparisons - Default locale was "SR" instead of "sr" - Comparisons used "EN" instead of "en" for shortDescription and benefits - These hardcoded English strings were being skipped due to wrong comparison --- src/components/product/ProductDetail.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/product/ProductDetail.tsx b/src/components/product/ProductDetail.tsx index 980169f..335655c 100644 --- a/src/components/product/ProductDetail.tsx +++ b/src/components/product/ProductDetail.tsx @@ -86,7 +86,7 @@ function StarRating({ rating = 5, count = 0 }: { rating?: number; count?: number ); } -export default function ProductDetail({ product, relatedProducts, locale = "SR" }: ProductDetailProps) { +export default function ProductDetail({ product, relatedProducts, locale = "sr" }: ProductDetailProps) { const t = useTranslations("ProductDetail"); const tProduct = useTranslations("Product"); const [selectedImage, setSelectedImage] = useState(0); @@ -134,12 +134,12 @@ export default function ProductDetail({ product, relatedProducts, locale = "SR" const shortDescription = localized.description ? localized.description.split('.')[0] + '.' - : locale === "EN" ? "Premium natural oil for your beauty routine." : "Premium prirodno ulje za vašu rutinu lepote."; + : locale === "en" ? "Premium natural oil for your beauty routine." : "Premium prirodno ulje za vašu rutinu lepote."; const benefits = product.metadata?.find(m => m.key === "benefits")?.value?.split(',') || [ - locale === "EN" ? "Natural" : "Prirodno", - locale === "EN" ? "Organic" : "Organsko", - locale === "EN" ? "Cruelty-free" : "Bez okrutnosti", + locale === "en" ? "Natural" : "Prirodno", + locale === "en" ? "Organic" : "Organsko", + locale === "en" ? "Cruelty-free" : "Bez okrutnosti", ]; return ( @@ -469,7 +469,7 @@ export default function ProductDetail({ product, relatedProducts, locale = "SR" )} - +