diff --git a/components/hero/hero.js b/components/hero/hero.js index 0a7d45e..144fcbe 100644 --- a/components/hero/hero.js +++ b/components/hero/hero.js @@ -1,6 +1,9 @@ +'use client'; // If this component is client-side only + import React from "react"; import Slider from "react-slick"; -import Link from 'next/link' +import Link from 'next/link'; +import { useTranslation } from 'next-i18next'; import "slick-carousel/slick/slick.css"; import "slick-carousel/slick/slick-theme.css"; @@ -16,24 +19,26 @@ const settings = { }; const Hero = () => { + const { t } = useTranslation('homeHero'); // Use 'home' namespace + return (
-
+
-

Family Immigration Assistance

+

{t('hero.slide1.title')}

-

Reuniting loved ones, one case at a time.

+

{t('hero.slide1.text')}

- About + {t('hero.slide1.button')}
@@ -41,54 +46,56 @@ const Hero = () => {
-
+
-

Employment & Work Visa Solutions

+

{t('hero.slide2.title')}

-

Your career deserves a global gateway.

+

{t('hero.slide2.text')}

- Our Approach + {t('hero.slide2.button')}
+
-
+
-

Investor & Business Immigration

+

{t('hero.slide3.title')}

-

Building futures through business opportunities.

+

{t('hero.slide3.text')}

- Services + {t('hero.slide3.button')}
+
-
+
-

Deportation Defense & Legal Representation

+

{t('hero.slide4.title')}

-

Fighting for your right to stay.

+

{t('hero.slide4.text')}

- Contact + {t('hero.slide4.button')}
@@ -103,7 +110,7 @@ const Hero = () => {
- ) -} + ); +}; -export default Hero; \ No newline at end of file +export default Hero; diff --git a/next-i18next.config.js b/next-i18next.config.js index 15ce4af..34240d4 100644 --- a/next-i18next.config.js +++ b/next-i18next.config.js @@ -4,7 +4,19 @@ module.exports = { locales: ['en', 'es'], localeDetection: false, }, - ns: ['common', 'menu'], + ns: ['common', 'menu', 'homeHero'], defaultNS: 'common', // localePath: './public/locales', }; + +// aakash + + +// Selvi + + +// Vidhya + + +// Alagu Raj + diff --git a/pages/about/index.js b/pages/about/index.js index 7c9d004..50c3782 100644 --- a/pages/about/index.js +++ b/pages/about/index.js @@ -21,6 +21,7 @@ import TestimonialSection from '../../components/aboutPage/TestimonialSection'; import TestimonialSection2 from '../../components/aboutPage/TestimonialSection2'; import bg from '/public/images/about/about-banner.webp' +import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; const AboutPage = () => { return ( @@ -42,3 +43,13 @@ const AboutPage = () => { ) }; export default AboutPage; + +// ✅ This enables translations (menu, and more if you add other namespaces) +export async function getStaticProps({ locale }) { + return { + props: { + ...(await serverSideTranslations(locale, ['common', 'menu'])), // Add 'home', 'footer', etc. if needed + }, + }; +} + diff --git a/pages/contact/index.js b/pages/contact/index.js index a89c45e..c0e970d 100644 --- a/pages/contact/index.js +++ b/pages/contact/index.js @@ -5,6 +5,7 @@ import Contactpage from '../../components/Contactpage/Contactpage' import Scrollbar from '../../components/scrollbar/scrollbar' import Footer from '../../components/footer/Footer'; import contact from '/public/images/contact/contact-banner.webp'; +import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; const ContactPage =() => { return( @@ -19,3 +20,12 @@ const ContactPage =() => { }; export default ContactPage; +// ✅ This enables translations (menu, and more if you add other namespaces) +export async function getStaticProps({ locale }) { + return { + props: { + ...(await serverSideTranslations(locale, ['common', 'menu'])), // Add 'home', 'footer', etc. if needed + }, + }; +} + diff --git a/pages/index.js b/pages/index.js index a53d047..2820601 100644 --- a/pages/index.js +++ b/pages/index.js @@ -16,31 +16,31 @@ import introImg from '/public/images/home/expert-immigration-guidance.webp'; import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; const HomePage = () => { - return ( - - - - - - - - - - - -