From 5bd1a0f167d84b71e1abf58b3980e06bcd584ed1 Mon Sep 17 00:00:00 2001 From: Unchained Date: Mon, 23 Mar 2026 18:35:52 +0200 Subject: [PATCH] feat: translate TestimonialsSection and HeroVideo with i18n --- src/components/home/HeroVideo.tsx | 22 ++++---- src/components/home/TestimonialsSection.tsx | 60 +++++++-------------- src/i18n/messages/en.json | 32 ++++++++++- src/i18n/messages/sr.json | 32 ++++++++++- 4 files changed, 93 insertions(+), 53 deletions(-) diff --git a/src/components/home/HeroVideo.tsx b/src/components/home/HeroVideo.tsx index 682fe66..498cd92 100644 --- a/src/components/home/HeroVideo.tsx +++ b/src/components/home/HeroVideo.tsx @@ -2,9 +2,12 @@ import { motion } from "framer-motion"; import Link from "next/link"; +import { useTranslations } from "next-intl"; import { ChevronDown } from "lucide-react"; export default function HeroVideo() { + const t = useTranslations("Home.hero"); + const scrollToContent = () => { const element = document.getElementById("main-content"); if (element) { @@ -47,7 +50,7 @@ export default function HeroVideo() { ))} - Loved by 50,000+ customers worldwide + {t("lovedBy")} @@ -58,9 +61,9 @@ export default function HeroVideo() { transition={{ duration: 0.8, delay: 0.5 }} className="text-4xl md:text-6xl lg:text-7xl font-medium mb-6 tracking-tight leading-tight" > - Transform Your Hair & Skin + {t("transformHeadline")}
- with 100% Natural Oils + {t("withNaturalOils")} {/* Subtitle - Expands on how */} @@ -70,8 +73,7 @@ export default function HeroVideo() { transition={{ duration: 0.6, delay: 0.7 }} className="text-lg md:text-xl text-white/80 mb-8 font-light max-w-2xl mx-auto leading-relaxed" > - Cold-pressed, organic oils handcrafted with love. - No additives, no preservatives—just nature's purest goodness for your daily beauty ritual. + {t("subtitleText")} {/* CTA Button - Action verb + value */} @@ -85,13 +87,13 @@ export default function HeroVideo() { href="/products" className="inline-block px-10 py-4 bg-white text-black text-[13px] uppercase tracking-[0.15em] font-semibold hover:bg-white/90 transition-all duration-300 hover:scale-105 shadow-lg hover:shadow-xl" > - Transform My Hair & Skin + {t("ctaButton")} - Learn Our Story + {t("learnStory")} @@ -106,19 +108,19 @@ export default function HeroVideo() { - 30-Day Money Back + {t("moneyBack")}
- Free Shipping Over 3,000 RSD + {t("freeShipping")}
- Cruelty Free + {t("crueltyFree")}
diff --git a/src/components/home/TestimonialsSection.tsx b/src/components/home/TestimonialsSection.tsx index 83d9571..a77ed6d 100644 --- a/src/components/home/TestimonialsSection.tsx +++ b/src/components/home/TestimonialsSection.tsx @@ -2,36 +2,20 @@ import { motion } from "framer-motion"; import { Star, Check } from "lucide-react"; - -const testimonials = [ - { - id: 1, - name: "Sarah M.", - skinType: "Dry, sensitive skin", - text: "I've tried countless oils over the years, but ManoonOils is different. My skin has never felt this nourished and healthy. The argan oil is now a staple in my routine.", - verified: true, - }, - { - id: 2, - name: "James K.", - skinType: "Hair care enthusiast", - text: "Finally found an oil that actually tames my frizz without making my hair greasy. The jojoba oil works wonders for my beard too. Highly recommend!", - verified: true, - }, - { - id: 3, - name: "Emma L.", - skinType: "Combination skin", - text: "Was skeptical at first but after 3 weeks of using the rosehip oil, my skin texture has improved dramatically. The quality is unmatched.", - verified: true, - }, -]; +import { useTranslations } from "next-intl"; export default function TestimonialsSection() { + const t = useTranslations("Testimonials"); + + const reviews = t.raw("reviews") as Array<{ + name: string; + skinType: string; + text: string; + }>; + return (
- {/* Header */}

- What our customers say + {t("title")}

- {/* Testimonials Grid */}
- {testimonials.map((testimonial, index) => ( + {reviews.map((review, index) => ( - {/* Stars */}
{[...Array(5)].map((_, i) => ( - {/* Quote */}

- “{testimonial.text}” + “{review.text}”

- {/* Author */}

- {testimonial.name} + {review.name}

- {testimonial.skinType} + {review.skinType}

- {testimonial.verified && ( -
- - Verified purchase -
- )} +
+ + {t("verified")} +
))} diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json index 115e402..e32769a 100644 --- a/src/i18n/messages/en.json +++ b/src/i18n/messages/en.json @@ -8,7 +8,16 @@ "Home": { "hero": { "title": "Premium Natural Oils", - "subtitle": "For hair and skin care" + "subtitle": "For hair and skin care", + "lovedBy": "Loved by 50,000+ customers worldwide", + "transformHeadline": "Transform Your Hair & Skin", + "withNaturalOils": "with 100% Natural Oils", + "subtitleText": "Cold-pressed, organic oils handcrafted with love. No additives, no preservatives—just nature's purest goodness for your daily beauty ritual.", + "ctaButton": "Transform My Hair & Skin", + "learnStory": "Learn Our Story", + "moneyBack": "30-Day Money Back", + "freeShipping": "Free Shipping Over 3,000 RSD", + "crueltyFree": "Cruelty Free" }, "collection": "Our Collection", "premiumOils": "Premium Natural Oils", @@ -145,5 +154,26 @@ "previous": "Previous", "search": "Search", "noResults": "No results found" + }, + "Testimonials": { + "title": "What our customers say", + "verified": "Verified purchase", + "reviews": [ + { + "name": "Sarah M.", + "skinType": "Dry, sensitive skin", + "text": "I've tried countless oils over the years, but ManoonOils is different. My skin has never felt this nourished and healthy. The argan oil is now a staple in my routine." + }, + { + "name": "James K.", + "skinType": "Hair care enthusiast", + "text": "Finally found an oil that actually tames my frizz without making my hair greasy. The jojoba oil works wonders for my beard too. Highly recommend!" + }, + { + "name": "Emma L.", + "skinType": "Combination skin", + "text": "Was skeptical at first but after 3 weeks of using the rosehip oil, my skin texture has improved dramatically. The quality is unmatched." + } + ] } } diff --git a/src/i18n/messages/sr.json b/src/i18n/messages/sr.json index 7b1f5a8..1276ec0 100644 --- a/src/i18n/messages/sr.json +++ b/src/i18n/messages/sr.json @@ -8,7 +8,16 @@ "Home": { "hero": { "title": "Premium prirodna ulja", - "subtitle": "Za negu kose i kože" + "subtitle": "Za negu kose i kože", + "lovedBy": "Omiljeno od 50.000+ kupaca širom sveta", + "transformHeadline": "Transformiši kosu i kožu", + "withNaturalOils": "sa 100% prirodnim uljima", + "subtitleText": "Hladno ceđena, organska ulja ručno pravljena sa ljubavlju. Bez aditiva, bez konzervanasa - samo najčistija dobrobit prirode za vašu svakodnevnu lepotu.", + "ctaButton": "Transformiši moju kosu i kožu", + "learnStory": "Saznaj našu priču", + "moneyBack": "Povrat novca 30 dana", + "freeShipping": "Besplatna dostava preko 3.000 RSD", + "crueltyFree": "Bez okrutnosti" }, "collection": "Naša kolekcija", "premiumOils": "Premium prirodna ulja", @@ -145,5 +154,26 @@ "previous": "Prethodno", "search": "Pretraga", "noResults": "Nema rezultata" + }, + "Testimonials": { + "title": "Šta naši kupci kažu", + "verified": "Potvrđena kupovina", + "reviews": [ + { + "name": "Milica J.", + "skinType": "Suva, osetljiva koža", + "text": "Isprobala sam bezbroj ulja tokom godina, ali ManoonOils je drugačije. Moja koža nikad nije bila ovako negovana i zdrava. Arganovo ulje je sada osnovni deo moje rutine." + }, + { + "name": "Marko P.", + "skinType": "Nega kose", + "text": "Konačno sam pronašla ulje koje zaista obuzdava moju kosu bez que je čini masnom. Jojobino ulje čini čuda i za moju bradu. Toplo preporučujem!" + }, + { + "name": "Ana K.", + "skinType": "Kombinovana koža", + "text": "U početku sam bila skeptična, ali nakon 3 nedelje korišćenja ulja od šipka, tekstura moje kože se drastično poboljšala. Kvalitet je neuporediv." + } + ] } }