From 2bbf2d8ee5f1ac551f839cb00999e32b04c6ad3f Mon Sep 17 00:00:00 2001 From: sina_sajjadi Date: Mon, 4 Nov 2024 13:43:47 +0330 Subject: [PATCH] feat : Internationalization added to site --- next-i18next.config.js | 8 +- next.config.js | 9 +- package-lock.json | 16 +- package.json | 4 +- public/locales/en/FAQ.json | 25 +++ public/locales/en/common.json | 118 ++++++++++++- public/locales/fr/common.json | 67 ++++++++ .../(account-pages)/(components)/Nav.tsx | 0 .../(account-pages)/account/page.tsx | 0 .../(account-pages)/bills/BillCard.tsx | 0 .../(account-pages)/bills/[slug]/page.tsx | 0 .../(account-pages)/bills/page.tsx | 0 .../{ => [locale]}/(account-pages)/layout.tsx | 0 .../(account-pages)/my-trips/page.tsx | 0 .../passengers-list/PassengerTable.tsx | 0 .../passengers-list/[id]/page.tsx | 2 +- .../(account-pages)/passengers-list/page.tsx | 0 .../(Header)/AvatarDropdown.tsx | 0 .../(Header)/CurrencyDropdown.tsx | 0 .../(Header)/DropdownTravelers.tsx | 0 .../(client-components)/(Header)/Header.tsx | 0 .../(client-components)/(Header)/Header3.tsx | 0 .../(Header)/LangDropdown.tsx | 81 +++++++-- .../(Header)/LangDropdownSingle.tsx | 0 .../(client-components)/(Header)/MainNav1.tsx | 0 .../(client-components)/(Header)/MainNav2.tsx | 0 .../(Header)/NotifyDropdown.tsx | 0 .../(Header)/SearchDropdown.tsx | 0 .../(Header)/SiteHeader.tsx | 0 .../(Header)/TemplatesDropdown.tsx | 0 .../StayDatesRangeInput.tsx | 0 .../(stay-search-form)/StaySearchForm.tsx | 0 .../(HeroSearchForm)/ButtonSubmit.tsx | 0 .../(HeroSearchForm)/ClearDataButton.tsx | 0 .../(HeroSearchForm)/GuestsInput.tsx | 0 .../(HeroSearchForm)/HeroSearchForm.tsx | 0 .../(HeroSearchForm)/LocationInput.tsx | 0 .../(car-search-form)/CarsSearchForm.tsx | 0 .../(flight-search-form)/FlightSearchForm.tsx | 0 .../PriceRangeInput.tsx | 0 .../PropertyTypeSelect.tsx | 0 .../RealestateSearchForm.tsx | 0 .../(stay-search-form)/StaySearchForm.tsx | 0 .../(HeroSearchForm2Mobile)/ButtonSubmit.tsx | 0 .../DatesRangeInput.tsx | 0 .../(HeroSearchForm2Mobile)/GuestsInput.tsx | 0 .../HeroSearchForm2Mobile.tsx | 0 .../HeroSearchForm2MobileFactory.tsx | 0 .../HeroSearchForm2RealEstateMobile.tsx | 0 .../(HeroSearchForm2Mobile)/LocationInput.tsx | 0 .../StayDatesRangeInput.tsx | 0 .../(stay-search-form)/StaySearchForm.tsx | 0 .../(HeroSearchFormSmall)/ButtonSubmit.tsx | 0 .../(HeroSearchFormSmall)/ClearDataButton.tsx | 0 .../(HeroSearchFormSmall)/GuestsInput.tsx | 0 .../HeroSearchFormSmall.tsx | 0 .../(HeroSearchFormSmall)/LocationInput.tsx | 0 .../(client-components)/type.ts | 0 .../(home)/SectionDowloadApp.tsx | 0 .../(home)/SectionGridFeatureProperty.tsx | 0 .../SectionGridFilterCard.tsx | 0 .../SectionGridHasMap.tsx | 0 .../(real-estate-listings)/TabFilters.tsx | 0 .../(real-estate-listings)/layout.tsx | 0 .../listing-real-estate-map/page.tsx | 0 .../listing-real-estate/page.tsx | 0 .../(server-components)/SectionHero.tsx | 13 +- .../(server-components)/SectionHero2.tsx | 0 .../(server-components)/SectionHero3.tsx | 0 .../SectionHeroArchivePage.tsx | 0 .../(stay-listings)/SectionGridFilterCard.tsx | 0 .../(stay-listings)/SectionGridHasMap.tsx | 0 .../(stay-listings)/TabFilters.tsx | 0 .../{ => [locale]}/(stay-listings)/layout.tsx | 0 .../(stay-listings)/listing-stay-map/page.tsx | 0 .../(stay-listings)/listing-stay/page.tsx | 0 .../{ => [locale]}/about/SectionFounder.tsx | 0 src/app/{ => [locale]}/about/SectionHero.tsx | 0 .../{ => [locale]}/about/SectionStatistic.tsx | 12 +- src/app/{ => [locale]}/about/page.tsx | 12 +- .../{ => [locale]}/add-listing/FormItem.tsx | 0 .../[[...stepIndex]]/PageAddListing1.tsx | 2 +- .../[[...stepIndex]]/PageAddListing10.tsx | 0 .../[[...stepIndex]]/PageAddListing2.tsx | 0 .../[[...stepIndex]]/PageAddListing3.tsx | 0 .../[[...stepIndex]]/PageAddListing4.tsx | 0 .../[[...stepIndex]]/PageAddListing5.tsx | 0 .../[[...stepIndex]]/PageAddListing6.tsx | 0 .../[[...stepIndex]]/PageAddListing7.tsx | 0 .../[[...stepIndex]]/PageAddListing8.tsx | 0 .../[[...stepIndex]]/PageAddListing9.tsx | 0 .../add-listing/[[...stepIndex]]/page.tsx | 0 .../{ => [locale]}/add-new-passenger/page.tsx | 0 src/app/{ => [locale]}/author/page.tsx | 0 src/app/{ => [locale]}/blog/Card12.tsx | 0 src/app/{ => [locale]}/blog/Card13.tsx | 0 src/app/{ => [locale]}/blog/Card3.tsx | 0 src/app/{ => [locale]}/blog/Card3Small.tsx | 0 src/app/{ => [locale]}/blog/SectionAds.tsx | 0 .../blog/SectionLatestPosts.tsx | 0 .../{ => [locale]}/blog/SectionMagazine5.tsx | 0 .../{ => [locale]}/blog/WidgetCategories.tsx | 0 .../{ => [locale]}/blog/WidgetHeading1.tsx | 0 src/app/{ => [locale]}/blog/WidgetPosts.tsx | 0 src/app/{ => [locale]}/blog/WidgetTags.tsx | 0 .../{ => [locale]}/blog/[...slug]/Survey.tsx | 0 .../{ => [locale]}/blog/[...slug]/layout.tsx | 0 .../{ => [locale]}/blog/[...slug]/page.tsx | 69 ++------ src/app/{ => [locale]}/blog/layout.tsx | 0 src/app/{ => [locale]}/blog/page.tsx | 0 src/app/{ => [locale]}/checkout/PageMain.tsx | 0 src/app/{ => [locale]}/checkout/page.tsx | 0 src/app/{ => [locale]}/contact/page.tsx | 0 .../{ => [locale]}/custom-history/page.tsx | 0 src/app/{ => [locale]}/custom-trip/page.tsx | 160 ++++++++---------- .../{faq/table.tsx => [locale]/faq/Table.tsx} | 0 src/app/[locale]/faq/page.tsx | 85 ++++++++++ .../{ => [locale]}/forgot-password/page.tsx | 0 src/app/[locale]/layout.tsx | 61 +++++++ src/app/{ => [locale]}/login/page.tsx | 0 src/app/{ => [locale]}/page.tsx | 2 +- src/app/{ => [locale]}/pay-done/page.tsx | 0 .../{ => [locale]}/signup/methodes/page.tsx | 0 .../{ => [locale]}/signup/otp-code/page.tsx | 0 src/app/{ => [locale]}/signup/page.tsx | 0 src/app/{ => [locale]}/subscription/page.tsx | 0 src/app/{ => [locale]}/tours/Card.tsx | 2 +- .../tours/SectionGridFilterCard.tsx | 0 src/app/{ => [locale]}/tours/TabFilters.tsx | 0 .../tours/[slug]/GuestsInput.tsx | 36 ++-- .../tours/[slug]/StayDatesRangeInput.tsx | 0 .../{ => [locale]}/tours/[slug]/constant.ts | 0 src/app/{ => [locale]}/tours/[slug]/page.tsx | 13 +- src/app/{ => [locale]}/tours/layout.tsx | 0 src/app/{ => [locale]}/tours/page.tsx | 0 src/app/faq/page.tsx | 93 ---------- src/app/layout.tsx | 59 +------ src/components/I18nProvider.tsx | 20 +++ src/components/MobileFooterSticky.tsx | 5 +- src/components/ModalReserveMobile.tsx | 2 +- src/components/ModalSelectGuests.tsx | 2 +- src/components/SectionGridFeaturePlaces.tsx | 4 +- src/components/StayCard2.tsx | 3 +- src/i18n.ts | 30 ++++ src/middleware.ts | 40 +++++ src/shared/Navigation/NavMobile.tsx | 2 +- yarn.lock | 16 +- 147 files changed, 672 insertions(+), 401 deletions(-) create mode 100644 public/locales/en/FAQ.json create mode 100644 public/locales/fr/common.json rename src/app/{ => [locale]}/(account-pages)/(components)/Nav.tsx (100%) rename src/app/{ => [locale]}/(account-pages)/account/page.tsx (100%) rename src/app/{ => [locale]}/(account-pages)/bills/BillCard.tsx (100%) rename src/app/{ => [locale]}/(account-pages)/bills/[slug]/page.tsx (100%) rename src/app/{ => [locale]}/(account-pages)/bills/page.tsx (100%) rename src/app/{ => [locale]}/(account-pages)/layout.tsx (100%) rename src/app/{ => [locale]}/(account-pages)/my-trips/page.tsx (100%) rename src/app/{ => [locale]}/(account-pages)/passengers-list/PassengerTable.tsx (100%) rename src/app/{ => [locale]}/(account-pages)/passengers-list/[id]/page.tsx (99%) rename src/app/{ => [locale]}/(account-pages)/passengers-list/page.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(Header)/AvatarDropdown.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(Header)/CurrencyDropdown.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(Header)/DropdownTravelers.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(Header)/Header.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(Header)/Header3.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(Header)/LangDropdown.tsx (63%) rename src/app/{ => [locale]}/(client-components)/(Header)/LangDropdownSingle.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(Header)/MainNav1.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(Header)/MainNav2.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(Header)/NotifyDropdown.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(Header)/SearchDropdown.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(Header)/SiteHeader.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(Header)/TemplatesDropdown.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm)/(stay-search-form)/StayDatesRangeInput.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm)/(stay-search-form)/StaySearchForm.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm)/ButtonSubmit.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm)/ClearDataButton.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm)/GuestsInput.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm)/HeroSearchForm.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm)/LocationInput.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm2Mobile)/(car-search-form)/CarsSearchForm.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm2Mobile)/(flight-search-form)/FlightSearchForm.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm2Mobile)/(real-estate-search-form)/PriceRangeInput.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm2Mobile)/(real-estate-search-form)/PropertyTypeSelect.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm2Mobile)/(real-estate-search-form)/RealestateSearchForm.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm2Mobile)/(stay-search-form)/StaySearchForm.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm2Mobile)/ButtonSubmit.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm2Mobile)/DatesRangeInput.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm2Mobile)/GuestsInput.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2Mobile.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2MobileFactory.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2RealEstateMobile.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchForm2Mobile)/LocationInput.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchFormSmall)/(stay-search-form)/StayDatesRangeInput.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchFormSmall)/(stay-search-form)/StaySearchForm.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchFormSmall)/ButtonSubmit.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchFormSmall)/ClearDataButton.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchFormSmall)/GuestsInput.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchFormSmall)/HeroSearchFormSmall.tsx (100%) rename src/app/{ => [locale]}/(client-components)/(HeroSearchFormSmall)/LocationInput.tsx (100%) rename src/app/{ => [locale]}/(client-components)/type.ts (100%) rename src/app/{ => [locale]}/(home)/SectionDowloadApp.tsx (100%) rename src/app/{ => [locale]}/(home)/SectionGridFeatureProperty.tsx (100%) rename src/app/{ => [locale]}/(real-estate-listings)/SectionGridFilterCard.tsx (100%) rename src/app/{ => [locale]}/(real-estate-listings)/SectionGridHasMap.tsx (100%) rename src/app/{ => [locale]}/(real-estate-listings)/TabFilters.tsx (100%) rename src/app/{ => [locale]}/(real-estate-listings)/layout.tsx (100%) rename src/app/{ => [locale]}/(real-estate-listings)/listing-real-estate-map/page.tsx (100%) rename src/app/{ => [locale]}/(real-estate-listings)/listing-real-estate/page.tsx (100%) rename src/app/{ => [locale]}/(server-components)/SectionHero.tsx (78%) rename src/app/{ => [locale]}/(server-components)/SectionHero2.tsx (100%) rename src/app/{ => [locale]}/(server-components)/SectionHero3.tsx (100%) rename src/app/{ => [locale]}/(server-components)/SectionHeroArchivePage.tsx (100%) rename src/app/{ => [locale]}/(stay-listings)/SectionGridFilterCard.tsx (100%) rename src/app/{ => [locale]}/(stay-listings)/SectionGridHasMap.tsx (100%) rename src/app/{ => [locale]}/(stay-listings)/TabFilters.tsx (100%) rename src/app/{ => [locale]}/(stay-listings)/layout.tsx (100%) rename src/app/{ => [locale]}/(stay-listings)/listing-stay-map/page.tsx (100%) rename src/app/{ => [locale]}/(stay-listings)/listing-stay/page.tsx (100%) rename src/app/{ => [locale]}/about/SectionFounder.tsx (100%) rename src/app/{ => [locale]}/about/SectionHero.tsx (100%) rename src/app/{ => [locale]}/about/SectionStatistic.tsx (76%) rename src/app/{ => [locale]}/about/page.tsx (70%) rename src/app/{ => [locale]}/add-listing/FormItem.tsx (100%) rename src/app/{ => [locale]}/add-listing/[[...stepIndex]]/PageAddListing1.tsx (99%) rename src/app/{ => [locale]}/add-listing/[[...stepIndex]]/PageAddListing10.tsx (100%) rename src/app/{ => [locale]}/add-listing/[[...stepIndex]]/PageAddListing2.tsx (100%) rename src/app/{ => [locale]}/add-listing/[[...stepIndex]]/PageAddListing3.tsx (100%) rename src/app/{ => [locale]}/add-listing/[[...stepIndex]]/PageAddListing4.tsx (100%) rename src/app/{ => [locale]}/add-listing/[[...stepIndex]]/PageAddListing5.tsx (100%) rename src/app/{ => [locale]}/add-listing/[[...stepIndex]]/PageAddListing6.tsx (100%) rename src/app/{ => [locale]}/add-listing/[[...stepIndex]]/PageAddListing7.tsx (100%) rename src/app/{ => [locale]}/add-listing/[[...stepIndex]]/PageAddListing8.tsx (100%) rename src/app/{ => [locale]}/add-listing/[[...stepIndex]]/PageAddListing9.tsx (100%) rename src/app/{ => [locale]}/add-listing/[[...stepIndex]]/page.tsx (100%) rename src/app/{ => [locale]}/add-new-passenger/page.tsx (100%) rename src/app/{ => [locale]}/author/page.tsx (100%) rename src/app/{ => [locale]}/blog/Card12.tsx (100%) rename src/app/{ => [locale]}/blog/Card13.tsx (100%) rename src/app/{ => [locale]}/blog/Card3.tsx (100%) rename src/app/{ => [locale]}/blog/Card3Small.tsx (100%) rename src/app/{ => [locale]}/blog/SectionAds.tsx (100%) rename src/app/{ => [locale]}/blog/SectionLatestPosts.tsx (100%) rename src/app/{ => [locale]}/blog/SectionMagazine5.tsx (100%) rename src/app/{ => [locale]}/blog/WidgetCategories.tsx (100%) rename src/app/{ => [locale]}/blog/WidgetHeading1.tsx (100%) rename src/app/{ => [locale]}/blog/WidgetPosts.tsx (100%) rename src/app/{ => [locale]}/blog/WidgetTags.tsx (100%) rename src/app/{ => [locale]}/blog/[...slug]/Survey.tsx (100%) rename src/app/{ => [locale]}/blog/[...slug]/layout.tsx (100%) rename src/app/{ => [locale]}/blog/[...slug]/page.tsx (68%) rename src/app/{ => [locale]}/blog/layout.tsx (100%) rename src/app/{ => [locale]}/blog/page.tsx (100%) rename src/app/{ => [locale]}/checkout/PageMain.tsx (100%) rename src/app/{ => [locale]}/checkout/page.tsx (100%) rename src/app/{ => [locale]}/contact/page.tsx (100%) rename src/app/{ => [locale]}/custom-history/page.tsx (100%) rename src/app/{ => [locale]}/custom-trip/page.tsx (74%) rename src/app/{faq/table.tsx => [locale]/faq/Table.tsx} (100%) create mode 100644 src/app/[locale]/faq/page.tsx rename src/app/{ => [locale]}/forgot-password/page.tsx (100%) create mode 100644 src/app/[locale]/layout.tsx rename src/app/{ => [locale]}/login/page.tsx (100%) rename src/app/{ => [locale]}/page.tsx (97%) rename src/app/{ => [locale]}/pay-done/page.tsx (100%) rename src/app/{ => [locale]}/signup/methodes/page.tsx (100%) rename src/app/{ => [locale]}/signup/otp-code/page.tsx (100%) rename src/app/{ => [locale]}/signup/page.tsx (100%) rename src/app/{ => [locale]}/subscription/page.tsx (100%) rename src/app/{ => [locale]}/tours/Card.tsx (98%) rename src/app/{ => [locale]}/tours/SectionGridFilterCard.tsx (100%) rename src/app/{ => [locale]}/tours/TabFilters.tsx (100%) rename src/app/{ => [locale]}/tours/[slug]/GuestsInput.tsx (84%) rename src/app/{ => [locale]}/tours/[slug]/StayDatesRangeInput.tsx (100%) rename src/app/{ => [locale]}/tours/[slug]/constant.ts (100%) rename src/app/{ => [locale]}/tours/[slug]/page.tsx (93%) rename src/app/{ => [locale]}/tours/layout.tsx (100%) rename src/app/{ => [locale]}/tours/page.tsx (100%) delete mode 100644 src/app/faq/page.tsx create mode 100644 src/components/I18nProvider.tsx create mode 100644 src/i18n.ts create mode 100644 src/middleware.ts diff --git a/next-i18next.config.js b/next-i18next.config.js index aa8f4d6..55c251b 100644 --- a/next-i18next.config.js +++ b/next-i18next.config.js @@ -2,9 +2,7 @@ const path = require("path"); module.exports = { i18n: { - locales: ["en", "de", "es", "ar", "he", "zh", "fa"], - defaultLocale: "en", - localeDetection: false, + locales: ['en', 'vi', 'fr'], // List all supported locales + defaultLocale: 'en', // Set the default locale }, - localePath: path.resolve("./public/locales"), -}; \ No newline at end of file +}; diff --git a/next.config.js b/next.config.js index 95705ee..b720da2 100644 --- a/next.config.js +++ b/next.config.js @@ -5,17 +5,10 @@ const { i18n } = require("./next-i18next.config"); module.exports = { - typescript: { - // !! WARN !! - // Dangerously allow production builds to successfully complete even if - // your project has type errors. - // !! WARN !! - ignoreBuildErrors: true, - }, + eslint: { ignoreDuringBuilds: false, }, - i18n, images: { remotePatterns: [ diff --git a/package-lock.json b/package-lock.json index 04c4363..0ed4be4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "framer-motion": "^10.12.16", "google-libphonenumber": "^3.2.38", "google-map-react": "^2.2.1", - "i18next": "^23.15.1", + "i18next": "^23.16.4", "libphonenumber-js": "^1.11.9", "lodash": "^4.17.21", "next": "^13.4.3", @@ -35,7 +35,7 @@ "react-datepicker": "^4.11.0", "react-dom": "^18.2.0", "react-hooks-global-state": "^2.1.0", - "react-i18next": "^15.0.2", + "react-i18next": "^15.1.0", "react-icons": "^5.3.0", "react-swipeable": "^7.0.0", "react-toastify": "^10.0.5", @@ -2749,9 +2749,9 @@ "license": "BSD-3-Clause" }, "node_modules/i18next": { - "version": "23.15.1", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.15.1.tgz", - "integrity": "sha512-wB4abZ3uK7EWodYisHl/asf8UYEhrI/vj/8aoSsrj/ZDxj4/UXPOa1KvFt1Fq5hkUHquNqwFlDprmjZ8iySgYA==", + "version": "23.16.4", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.16.4.tgz", + "integrity": "sha512-9NIYBVy9cs4wIqzurf7nLXPyf3R78xYbxExVqHLK9od3038rjpyOEzW+XB130kZ1N4PZ9inTtJ471CRJ4Ituyg==", "funding": [ { "type": "individual", @@ -4335,9 +4335,9 @@ } }, "node_modules/react-i18next": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-15.0.2.tgz", - "integrity": "sha512-z0W3/RES9Idv3MmJUcf0mDNeeMOUXe+xoL0kPfQPbDoZHmni/XsIoq5zgT2MCFUiau283GuBUK578uD/mkAbLQ==", + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-15.1.0.tgz", + "integrity": "sha512-zj3nJynMnZsy2gPZiOTC7XctCY5eQGqT3tcKMmfJWC9FMvgd+960w/adq61j8iPzpwmsXejqID9qC3Mqu1Xu2Q==", "dependencies": { "@babel/runtime": "^7.25.0", "html-parse-stringify": "^3.0.1" diff --git a/package.json b/package.json index 9396ca2..8825d58 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "framer-motion": "^10.12.16", "google-libphonenumber": "^3.2.38", "google-map-react": "^2.2.1", - "i18next": "^23.15.1", + "i18next": "^23.16.4", "libphonenumber-js": "^1.11.9", "lodash": "^4.17.21", "next": "^13.4.3", @@ -42,7 +42,7 @@ "react-datepicker": "^4.11.0", "react-dom": "^18.2.0", "react-hooks-global-state": "^2.1.0", - "react-i18next": "^15.0.2", + "react-i18next": "^15.1.0", "react-icons": "^5.3.0", "react-swipeable": "^7.0.0", "react-toastify": "^10.0.5", diff --git a/public/locales/en/FAQ.json b/public/locales/en/FAQ.json new file mode 100644 index 0000000..e70cd29 --- /dev/null +++ b/public/locales/en/FAQ.json @@ -0,0 +1,25 @@ +{ + "faqTitle": "Frequently Asked Questions", + "faqSubtitle": "Have Questions? We are here to help you!", + "faqQuestion1": "How can I book a tour on your site?", + "faqAnswer1": "To book a tour, simply select your desired destination from the 'List of Tours', choose your dates, and follow the steps to complete the booking process.", + "faqQuestion2": "Can I customize my tour?", + "faqAnswer2": "Yes, our 'Customize Tour' feature allows you to tailor your journey based on your preferences. Click on 'Customize Tour' at the top of the page to start personalizing your experience.", + "faqQuestion3": "What payment methods do you accept?", + "faqAnswer3": "We accept all major credit cards, PayPal, and bank transfers. You can choose your preferred method during the checkout process.", + "faqQuestion4": "How do I know my booking is confirmed?", + "faqAnswer4": "Once you complete the payment process, you will receive a confirmation email with all the details of your booking. You can also view your booking details in your account dashboard.", + "faqQuestion5": "Can I cancel or modify my booking?", + "faqAnswer5": "Yes, you can cancel or modify your booking from your account. Please note that cancellations must be made at least 24 hours before the tour starts to be eligible for a refund.", + "faqQuestion6": "Are there any hidden fees?", + "faqAnswer6": "No, all fees are transparent and shown upfront before you complete your booking. We ensure there are no hidden fees.", + "faqQuestion7": "Do you offer group discounts?", + "faqAnswer7": "Yes, we offer group discounts for larger bookings. Please contact our support team for more information on group rates.", + "faqQuestion8": "Is travel insurance included in the booking?", + "faqAnswer8": "Yes, all our tour packages include basic travel insurance. You can choose to upgrade your insurance package during the checkout process.", + "faqQuestion9": "What happens if the tour is canceled by the provider?", + "faqAnswer9": "If the tour is canceled by the provider due to unforeseen circumstances, you will receive a full refund or the option to reschedule your tour.", + "faqQuestion10": "How can I contact customer support?", + "faqAnswer10": "You can contact customer support by clicking the 'Contact Us' button at the bottom of the page or by visiting our support section." + } + \ No newline at end of file diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 0c3dfe8..f1ff91e 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -1,6 +1,114 @@ { - "hello": "Hello", - "welcome": "Welcome to our website", - "language": "Language" - } - \ No newline at end of file + "home": "Home", + "allTours": "All Tours", + "blogs": "Blogs", + "faq": "FAQ", + "aboutUs": "About Us", + "customTour": "Custom Tour", + "searchPlaceholder": "Where to?", + "searchDescription": "Anywhere • Any week • Add guests", + "beginAdventure": "Begin your spiritual adventure", + "planPilgrimage": "Plan your pilgrimage with ease. Find the best accommodations, transportation, and guided experiences to Shia shrines around the world", + "startJourney": "Start your journey", + "listOfTours": "List of Tours", + "exploreTours": "Explore tours and accommodations tailored for a spiritual and memorable journey", + "tourPeriod": "Tour period", + "tourPeriodDescription": "Start - End", + "guests": "Guests", + "addGuests": "Add guests", + "available": "Available", + "soldOut": "Sold Out", + "showMore": "Show me more", + "happeningCities": "Happening cities", + "costEffectiveAdvertising": "Cost-effective advertising", + "costEffectiveDescription": "With a free listing, you can advertise your rental with no upfront costs", + "reachMillions": "Reach millions with Chisfis", + "reachMillionsDescription": "Millions of people are searching for unique places to stay around the world", + "secureAndSimple": "Secure and simple", + "secureDescription": "A Holiday Lettings listing gives you a secure and easy way to take bookings and payments online", + "mobileApps": "Mobile Apps", + "mobileAppsDescription": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed dapibus porttitor nisl, sit amet finibus libero.", + "installation": "Installation", + "releaseNotes": "Release Notes", + "upgradeGuide": "Upgrade Guide", + "browserSupport": "Browser Support", + "editorSupport": "Editor Support", + "designFeatures": "Design features", + "prototyping": "Prototyping", + "designSystems": "Design systems", + "pricing": "Pricing", + "security": "Security", + "bestPractices": "Best practices", + "support": "Support", + "developers": "Developers", + "learnDesign": "Learn design", + "releases": "Releases", + "discussionForums": "Discussion Forums", + "codeOfConduct": "Code of Conduct", + "communityResources": "Community Resources", + "contributing": "Contributing", + "concurrentMode": "Concurrent Mode", + "goodNews": "Good news from far away", + "whatPeopleThink": "Let's see what people think of Chisfis", + "testimonial": "This place is exactly like the picture posted on Chisfis. Great service, we had a great stay!", + "clientName": "Tiana Abie", + "clientLocation": "Malaysia", + "myTrips": "My Trips", + "account": "Account", + "menu": "Menu", + "gettingStarted": "Getting started", + "explore": "Explore", + "resources": "Resources", + "community": "Community", + "placeType": "Type of place", + "noTours": "No tours available", + "itinerary": "Itinerary", + "itineraryTitle": "Itinerary", + "total": "Total", + "reserve": "Reserve", + "tourFeatures": "Tour Features", + "tourFeaturesTitle": "Tour Features", + "startRating": "Start Rating", + "listingDetails": "Details", + "imageAlt": "Image of the tour", + "loading": "Loading...", + "adults": "Adults", + "adultsDesc": "Ages 13 or above", + "children": "Children", + "childrenDesc": "Ages 2–12", + "infants": "Infants", + "infantsDesc": "Ages 0–2", + "traveler": "Traveler", + "responses": "Responses ({{count}})", + "submit": "Submit", + "cancel": "Cancel", + "relatedPosts": "Related Posts", + "aboutUsHeading": "👋 About Us.", + "aboutUsSubheading": "We are a passionate team dedicated to crafting unforgettable travel experiences for explorers and dreamers alike. From serene escapes on tropical beaches to adrenaline-fueled adventures in exotic locales, we curate journeys that are as unique as you are. Join us and let’s explore the world, one adventure at a time!", + "statisticTitle": "🚀 Fast Facts", + "statisticDescription": "We’re impartial and independent, and every day we create distinctive, world-class programmes and content.", + "statisticHeading1": "10 million", + "statisticSubHeading1": "Articles have been public around the world (as of Sept. 30, 2021)", + "statisticHeading2": "100,000", + "statisticSubHeading2": "Registered users account (as of Sept. 30, 2021)", + "statisticHeading3": "220+", + "statisticSubHeading3": "Countries and regions have our presence (as of Sept. 30, 2021)", + "customTrip": "Custom Trip", + "guide": "Guide", + "guideDescription": "First, write the origin of your departure, then choose the first destination of your trip, the number of nights of stay, and the means of travel, then choose your travel destinations if you wish.", + "beginYourTrip": "Begin your trip", + "startDate": "Start Date", + "numberOfPassengers": "Number Of Passengers", + "destination": "Destination", + "selectCity": "Select City", + "transportation": "Transportation", + "selectTransport": "Select Transport", + "hotel": "Hotel", + "selectHotel": "Select Hotel", + "duration": "Duration", + "finishDate": "Finish date", + "addDestination": "Add Destination", + "continue": "Continue", + "successMessage": "Successfully Registered", + "to": "to" +} diff --git a/public/locales/fr/common.json b/public/locales/fr/common.json new file mode 100644 index 0000000..4bc4bbe --- /dev/null +++ b/public/locales/fr/common.json @@ -0,0 +1,67 @@ +{ + "home": "Accueil", + "allTours": "Tous les Tours", + "blogs": "Blogs", + "faq": "FAQ", + "aboutUs": "À propos de nous", + "customTour": "Visite sur mesure", + "searchPlaceholder": "Où aller ?", + "searchDescription": "Partout • À toute semaine • Ajouter des invités", + "beginAdventure": "Commencez votre aventure spirituelle", + "planPilgrimage": "Planifiez votre pèlerinage avec facilité. Trouvez les meilleures accommodations, le transport et les expériences guidées vers les sanctuaires chiites à travers le monde", + "startJourney": "Commencer votre voyage", + "listOfTours": "Liste des Tours", + "exploreTours": "Explorez les visites et les hébergements adaptés pour un voyage spirituel et mémorable", + "tourPeriod": "Période de visite", + "tourPeriodDescription": "Début - Fin", + "guests": "Invités", + "addGuests": "Ajouter des invités", + "available": "Disponible", + "soldOut": "Épuisé", + "showMore": "Montrez-moi plus", + "happeningCities": "Villes en vogue", + "costEffectiveAdvertising": "Publicité rentable", + "costEffectiveDescription": "Avec une annonce gratuite, vous pouvez promouvoir votre location sans frais initiaux", + "reachMillions": "Atteignez des millions avec Chisfis", + "reachMillionsDescription": "Des millions de personnes recherchent des lieux uniques où séjourner à travers le monde", + "secureAndSimple": "Sécurisé et simple", + "secureDescription": "Une annonce de Holiday Lettings vous offre un moyen sécurisé et facile de prendre des réservations et des paiements en ligne", + "mobileApps": "Applications Mobiles", + "mobileAppsDescription": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed dapibus porttitor nisl, sit amet finibus libero.", + "installation": "Installation", + "releaseNotes": "Notes de version", + "upgradeGuide": "Guide de mise à niveau", + "browserSupport": "Support des navigateurs", + "editorSupport": "Support de l'éditeur", + "designFeatures": "Fonctionnalités de conception", + "prototyping": "Prototypage", + "designSystems": "Systèmes de design", + "pricing": "Tarification", + "security": "Sécurité", + "bestPractices": "Meilleures pratiques", + "support": "Support", + "developers": "Développeurs", + "learnDesign": "Apprendre la conception", + "releases": "Versions", + "discussionForums": "Forums de discussion", + "codeOfConduct": "Code de conduite", + "communityResources": "Ressources communautaires", + "contributing": "Contribuer", + "concurrentMode": "Mode concurrent", + "goodNews": "Bonne nouvelle de loin", + "whatPeopleThink": "Voyons ce que les gens pensent de Chisfis", + "testimonial": "Cet endroit est exactement comme la photo publiée sur Chisfis. Excellent service, nous avons passé un excellent séjour !", + "clientName": "Tiana Abie", + "clientLocation": "Malaisie", + "myTrips": "Mes Voyages", + "account": "Compte", + "menu": "Menu", + "gettingStarted": "Commencer", + "explore": "Explorer", + "resources": "Ressources", + "community": "Communauté", + "placeType": "Type de lieu", + "noTours": "Aucun tour disponible" + + } + \ No newline at end of file diff --git a/src/app/(account-pages)/(components)/Nav.tsx b/src/app/[locale]/(account-pages)/(components)/Nav.tsx similarity index 100% rename from src/app/(account-pages)/(components)/Nav.tsx rename to src/app/[locale]/(account-pages)/(components)/Nav.tsx diff --git a/src/app/(account-pages)/account/page.tsx b/src/app/[locale]/(account-pages)/account/page.tsx similarity index 100% rename from src/app/(account-pages)/account/page.tsx rename to src/app/[locale]/(account-pages)/account/page.tsx diff --git a/src/app/(account-pages)/bills/BillCard.tsx b/src/app/[locale]/(account-pages)/bills/BillCard.tsx similarity index 100% rename from src/app/(account-pages)/bills/BillCard.tsx rename to src/app/[locale]/(account-pages)/bills/BillCard.tsx diff --git a/src/app/(account-pages)/bills/[slug]/page.tsx b/src/app/[locale]/(account-pages)/bills/[slug]/page.tsx similarity index 100% rename from src/app/(account-pages)/bills/[slug]/page.tsx rename to src/app/[locale]/(account-pages)/bills/[slug]/page.tsx diff --git a/src/app/(account-pages)/bills/page.tsx b/src/app/[locale]/(account-pages)/bills/page.tsx similarity index 100% rename from src/app/(account-pages)/bills/page.tsx rename to src/app/[locale]/(account-pages)/bills/page.tsx diff --git a/src/app/(account-pages)/layout.tsx b/src/app/[locale]/(account-pages)/layout.tsx similarity index 100% rename from src/app/(account-pages)/layout.tsx rename to src/app/[locale]/(account-pages)/layout.tsx diff --git a/src/app/(account-pages)/my-trips/page.tsx b/src/app/[locale]/(account-pages)/my-trips/page.tsx similarity index 100% rename from src/app/(account-pages)/my-trips/page.tsx rename to src/app/[locale]/(account-pages)/my-trips/page.tsx diff --git a/src/app/(account-pages)/passengers-list/PassengerTable.tsx b/src/app/[locale]/(account-pages)/passengers-list/PassengerTable.tsx similarity index 100% rename from src/app/(account-pages)/passengers-list/PassengerTable.tsx rename to src/app/[locale]/(account-pages)/passengers-list/PassengerTable.tsx diff --git a/src/app/(account-pages)/passengers-list/[id]/page.tsx b/src/app/[locale]/(account-pages)/passengers-list/[id]/page.tsx similarity index 99% rename from src/app/(account-pages)/passengers-list/[id]/page.tsx rename to src/app/[locale]/(account-pages)/passengers-list/[id]/page.tsx index d4231ef..c402afa 100644 --- a/src/app/(account-pages)/passengers-list/[id]/page.tsx +++ b/src/app/[locale]/(account-pages)/passengers-list/[id]/page.tsx @@ -4,7 +4,7 @@ import React, { useEffect, useState } from "react"; import { FC } from "react"; import ButtonPrimary from "@/shared/ButtonPrimary"; import Input from "@/shared/Input"; -import FormItem from "@/app/add-listing/FormItem"; +import FormItem from "@/app/[locale]/add-listing/FormItem"; import getImageURL from "@/components/api/getImageURL"; import axiosInstance from "@/components/api/axios"; import { useRouter } from "next/navigation"; diff --git a/src/app/(account-pages)/passengers-list/page.tsx b/src/app/[locale]/(account-pages)/passengers-list/page.tsx similarity index 100% rename from src/app/(account-pages)/passengers-list/page.tsx rename to src/app/[locale]/(account-pages)/passengers-list/page.tsx diff --git a/src/app/(client-components)/(Header)/AvatarDropdown.tsx b/src/app/[locale]/(client-components)/(Header)/AvatarDropdown.tsx similarity index 100% rename from src/app/(client-components)/(Header)/AvatarDropdown.tsx rename to src/app/[locale]/(client-components)/(Header)/AvatarDropdown.tsx diff --git a/src/app/(client-components)/(Header)/CurrencyDropdown.tsx b/src/app/[locale]/(client-components)/(Header)/CurrencyDropdown.tsx similarity index 100% rename from src/app/(client-components)/(Header)/CurrencyDropdown.tsx rename to src/app/[locale]/(client-components)/(Header)/CurrencyDropdown.tsx diff --git a/src/app/(client-components)/(Header)/DropdownTravelers.tsx b/src/app/[locale]/(client-components)/(Header)/DropdownTravelers.tsx similarity index 100% rename from src/app/(client-components)/(Header)/DropdownTravelers.tsx rename to src/app/[locale]/(client-components)/(Header)/DropdownTravelers.tsx diff --git a/src/app/(client-components)/(Header)/Header.tsx b/src/app/[locale]/(client-components)/(Header)/Header.tsx similarity index 100% rename from src/app/(client-components)/(Header)/Header.tsx rename to src/app/[locale]/(client-components)/(Header)/Header.tsx diff --git a/src/app/(client-components)/(Header)/Header3.tsx b/src/app/[locale]/(client-components)/(Header)/Header3.tsx similarity index 100% rename from src/app/(client-components)/(Header)/Header3.tsx rename to src/app/[locale]/(client-components)/(Header)/Header3.tsx diff --git a/src/app/(client-components)/(Header)/LangDropdown.tsx b/src/app/[locale]/(client-components)/(Header)/LangDropdown.tsx similarity index 63% rename from src/app/(client-components)/(Header)/LangDropdown.tsx rename to src/app/[locale]/(client-components)/(Header)/LangDropdown.tsx index 8ec4695..c88ebfb 100644 --- a/src/app/(client-components)/(Header)/LangDropdown.tsx +++ b/src/app/[locale]/(client-components)/(Header)/LangDropdown.tsx @@ -1,15 +1,29 @@ -import React, { Fragment, useState } from "react"; +import React, { Fragment, useState, useEffect } from "react"; import { Popover, Tab, Transition } from "@headlessui/react"; +import { useRouter, usePathname } from "next/navigation"; import { ChevronDownIcon } from "@heroicons/react/24/outline"; import { MdOutlineLanguage } from "react-icons/md"; -import { useTranslation } from "next-i18next"; -import { useRouter } from "next/navigation"; // Importing from next/navigation // Language options const languageOptions = [ - { id: "en", name: "English", description: "United States", icon: }, - { id: "vi", name: "Vietnamese", description: "Vietnam", icon: }, - { id: "fr", name: "French", description: "France", icon: }, + { + id: "en", + name: "English", + description: "United States", + icon: , + }, + { + id: "vi", + name: "Vietnamese", + description: "Vietnam", + icon: , + }, + { + id: "fr", + name: "French", + description: "France", + icon: , + }, ]; interface LangDropdownProps { @@ -25,14 +39,35 @@ const LangDropdown: React.FC = ({ panelClassName = "top-full right-0 max-w-sm w-96", className = "hidden md:flex", }) => { - const { t } = useTranslation("common"); const router = useRouter(); + const pathname = usePathname(); const [selectedItem, setSelectedItem] = useState(languageOptions[0]); - // Handle language selection and route change - const handleItemClick = (option: any) => { - setSelectedItem(option); - router.push(`/${option.id}`); // Change locale using next/navigation's router + // Update selectedItem based on the current locale in the URL + useEffect(() => { + const locales = ["en", "vi", "fr"]; + const segments = pathname.split("/").filter(Boolean); + const currentLocale = locales.includes(segments[0]) ? segments[0] : "en"; + const newSelectedItem = + languageOptions.find((item) => item.id === currentLocale) || + languageOptions[0]; + setSelectedItem(newSelectedItem); + }, [pathname]); + + const handleLanguageChange = (locale: string) => { + const segments = pathname.split("/").filter(Boolean); + + // Remove the current locale if present + const locales = ["en", "vi", "fr"]; + if (locales.includes(segments[0])) { + segments.shift(); + } + + // Prepend the new locale + const newPathname = `/${locale}/${segments.join("/")}`; + + // Navigate to the new locale path + router.push(newPathname); }; return ( @@ -83,22 +118,32 @@ const LangDropdown: React.FC = ({ - +
{languageOptions.map((item) => ( ))} diff --git a/src/app/(client-components)/(Header)/LangDropdownSingle.tsx b/src/app/[locale]/(client-components)/(Header)/LangDropdownSingle.tsx similarity index 100% rename from src/app/(client-components)/(Header)/LangDropdownSingle.tsx rename to src/app/[locale]/(client-components)/(Header)/LangDropdownSingle.tsx diff --git a/src/app/(client-components)/(Header)/MainNav1.tsx b/src/app/[locale]/(client-components)/(Header)/MainNav1.tsx similarity index 100% rename from src/app/(client-components)/(Header)/MainNav1.tsx rename to src/app/[locale]/(client-components)/(Header)/MainNav1.tsx diff --git a/src/app/(client-components)/(Header)/MainNav2.tsx b/src/app/[locale]/(client-components)/(Header)/MainNav2.tsx similarity index 100% rename from src/app/(client-components)/(Header)/MainNav2.tsx rename to src/app/[locale]/(client-components)/(Header)/MainNav2.tsx diff --git a/src/app/(client-components)/(Header)/NotifyDropdown.tsx b/src/app/[locale]/(client-components)/(Header)/NotifyDropdown.tsx similarity index 100% rename from src/app/(client-components)/(Header)/NotifyDropdown.tsx rename to src/app/[locale]/(client-components)/(Header)/NotifyDropdown.tsx diff --git a/src/app/(client-components)/(Header)/SearchDropdown.tsx b/src/app/[locale]/(client-components)/(Header)/SearchDropdown.tsx similarity index 100% rename from src/app/(client-components)/(Header)/SearchDropdown.tsx rename to src/app/[locale]/(client-components)/(Header)/SearchDropdown.tsx diff --git a/src/app/(client-components)/(Header)/SiteHeader.tsx b/src/app/[locale]/(client-components)/(Header)/SiteHeader.tsx similarity index 100% rename from src/app/(client-components)/(Header)/SiteHeader.tsx rename to src/app/[locale]/(client-components)/(Header)/SiteHeader.tsx diff --git a/src/app/(client-components)/(Header)/TemplatesDropdown.tsx b/src/app/[locale]/(client-components)/(Header)/TemplatesDropdown.tsx similarity index 100% rename from src/app/(client-components)/(Header)/TemplatesDropdown.tsx rename to src/app/[locale]/(client-components)/(Header)/TemplatesDropdown.tsx diff --git a/src/app/(client-components)/(HeroSearchForm)/(stay-search-form)/StayDatesRangeInput.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm)/(stay-search-form)/StayDatesRangeInput.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm)/(stay-search-form)/StayDatesRangeInput.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm)/(stay-search-form)/StayDatesRangeInput.tsx diff --git a/src/app/(client-components)/(HeroSearchForm)/(stay-search-form)/StaySearchForm.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm)/(stay-search-form)/StaySearchForm.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm)/(stay-search-form)/StaySearchForm.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm)/(stay-search-form)/StaySearchForm.tsx diff --git a/src/app/(client-components)/(HeroSearchForm)/ButtonSubmit.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm)/ButtonSubmit.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm)/ButtonSubmit.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm)/ButtonSubmit.tsx diff --git a/src/app/(client-components)/(HeroSearchForm)/ClearDataButton.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm)/ClearDataButton.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm)/ClearDataButton.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm)/ClearDataButton.tsx diff --git a/src/app/(client-components)/(HeroSearchForm)/GuestsInput.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm)/GuestsInput.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm)/GuestsInput.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm)/GuestsInput.tsx diff --git a/src/app/(client-components)/(HeroSearchForm)/HeroSearchForm.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm)/HeroSearchForm.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm)/HeroSearchForm.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm)/HeroSearchForm.tsx diff --git a/src/app/(client-components)/(HeroSearchForm)/LocationInput.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm)/LocationInput.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm)/LocationInput.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm)/LocationInput.tsx diff --git a/src/app/(client-components)/(HeroSearchForm2Mobile)/(car-search-form)/CarsSearchForm.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/(car-search-form)/CarsSearchForm.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm2Mobile)/(car-search-form)/CarsSearchForm.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/(car-search-form)/CarsSearchForm.tsx diff --git a/src/app/(client-components)/(HeroSearchForm2Mobile)/(flight-search-form)/FlightSearchForm.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/(flight-search-form)/FlightSearchForm.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm2Mobile)/(flight-search-form)/FlightSearchForm.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/(flight-search-form)/FlightSearchForm.tsx diff --git a/src/app/(client-components)/(HeroSearchForm2Mobile)/(real-estate-search-form)/PriceRangeInput.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/(real-estate-search-form)/PriceRangeInput.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm2Mobile)/(real-estate-search-form)/PriceRangeInput.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/(real-estate-search-form)/PriceRangeInput.tsx diff --git a/src/app/(client-components)/(HeroSearchForm2Mobile)/(real-estate-search-form)/PropertyTypeSelect.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/(real-estate-search-form)/PropertyTypeSelect.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm2Mobile)/(real-estate-search-form)/PropertyTypeSelect.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/(real-estate-search-form)/PropertyTypeSelect.tsx diff --git a/src/app/(client-components)/(HeroSearchForm2Mobile)/(real-estate-search-form)/RealestateSearchForm.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/(real-estate-search-form)/RealestateSearchForm.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm2Mobile)/(real-estate-search-form)/RealestateSearchForm.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/(real-estate-search-form)/RealestateSearchForm.tsx diff --git a/src/app/(client-components)/(HeroSearchForm2Mobile)/(stay-search-form)/StaySearchForm.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/(stay-search-form)/StaySearchForm.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm2Mobile)/(stay-search-form)/StaySearchForm.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/(stay-search-form)/StaySearchForm.tsx diff --git a/src/app/(client-components)/(HeroSearchForm2Mobile)/ButtonSubmit.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/ButtonSubmit.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm2Mobile)/ButtonSubmit.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/ButtonSubmit.tsx diff --git a/src/app/(client-components)/(HeroSearchForm2Mobile)/DatesRangeInput.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/DatesRangeInput.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm2Mobile)/DatesRangeInput.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/DatesRangeInput.tsx diff --git a/src/app/(client-components)/(HeroSearchForm2Mobile)/GuestsInput.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/GuestsInput.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm2Mobile)/GuestsInput.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/GuestsInput.tsx diff --git a/src/app/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2Mobile.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2Mobile.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2Mobile.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2Mobile.tsx diff --git a/src/app/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2MobileFactory.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2MobileFactory.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2MobileFactory.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2MobileFactory.tsx diff --git a/src/app/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2RealEstateMobile.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2RealEstateMobile.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2RealEstateMobile.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2RealEstateMobile.tsx diff --git a/src/app/(client-components)/(HeroSearchForm2Mobile)/LocationInput.tsx b/src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/LocationInput.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchForm2Mobile)/LocationInput.tsx rename to src/app/[locale]/(client-components)/(HeroSearchForm2Mobile)/LocationInput.tsx diff --git a/src/app/(client-components)/(HeroSearchFormSmall)/(stay-search-form)/StayDatesRangeInput.tsx b/src/app/[locale]/(client-components)/(HeroSearchFormSmall)/(stay-search-form)/StayDatesRangeInput.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchFormSmall)/(stay-search-form)/StayDatesRangeInput.tsx rename to src/app/[locale]/(client-components)/(HeroSearchFormSmall)/(stay-search-form)/StayDatesRangeInput.tsx diff --git a/src/app/(client-components)/(HeroSearchFormSmall)/(stay-search-form)/StaySearchForm.tsx b/src/app/[locale]/(client-components)/(HeroSearchFormSmall)/(stay-search-form)/StaySearchForm.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchFormSmall)/(stay-search-form)/StaySearchForm.tsx rename to src/app/[locale]/(client-components)/(HeroSearchFormSmall)/(stay-search-form)/StaySearchForm.tsx diff --git a/src/app/(client-components)/(HeroSearchFormSmall)/ButtonSubmit.tsx b/src/app/[locale]/(client-components)/(HeroSearchFormSmall)/ButtonSubmit.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchFormSmall)/ButtonSubmit.tsx rename to src/app/[locale]/(client-components)/(HeroSearchFormSmall)/ButtonSubmit.tsx diff --git a/src/app/(client-components)/(HeroSearchFormSmall)/ClearDataButton.tsx b/src/app/[locale]/(client-components)/(HeroSearchFormSmall)/ClearDataButton.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchFormSmall)/ClearDataButton.tsx rename to src/app/[locale]/(client-components)/(HeroSearchFormSmall)/ClearDataButton.tsx diff --git a/src/app/(client-components)/(HeroSearchFormSmall)/GuestsInput.tsx b/src/app/[locale]/(client-components)/(HeroSearchFormSmall)/GuestsInput.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchFormSmall)/GuestsInput.tsx rename to src/app/[locale]/(client-components)/(HeroSearchFormSmall)/GuestsInput.tsx diff --git a/src/app/(client-components)/(HeroSearchFormSmall)/HeroSearchFormSmall.tsx b/src/app/[locale]/(client-components)/(HeroSearchFormSmall)/HeroSearchFormSmall.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchFormSmall)/HeroSearchFormSmall.tsx rename to src/app/[locale]/(client-components)/(HeroSearchFormSmall)/HeroSearchFormSmall.tsx diff --git a/src/app/(client-components)/(HeroSearchFormSmall)/LocationInput.tsx b/src/app/[locale]/(client-components)/(HeroSearchFormSmall)/LocationInput.tsx similarity index 100% rename from src/app/(client-components)/(HeroSearchFormSmall)/LocationInput.tsx rename to src/app/[locale]/(client-components)/(HeroSearchFormSmall)/LocationInput.tsx diff --git a/src/app/(client-components)/type.ts b/src/app/[locale]/(client-components)/type.ts similarity index 100% rename from src/app/(client-components)/type.ts rename to src/app/[locale]/(client-components)/type.ts diff --git a/src/app/(home)/SectionDowloadApp.tsx b/src/app/[locale]/(home)/SectionDowloadApp.tsx similarity index 100% rename from src/app/(home)/SectionDowloadApp.tsx rename to src/app/[locale]/(home)/SectionDowloadApp.tsx diff --git a/src/app/(home)/SectionGridFeatureProperty.tsx b/src/app/[locale]/(home)/SectionGridFeatureProperty.tsx similarity index 100% rename from src/app/(home)/SectionGridFeatureProperty.tsx rename to src/app/[locale]/(home)/SectionGridFeatureProperty.tsx diff --git a/src/app/(real-estate-listings)/SectionGridFilterCard.tsx b/src/app/[locale]/(real-estate-listings)/SectionGridFilterCard.tsx similarity index 100% rename from src/app/(real-estate-listings)/SectionGridFilterCard.tsx rename to src/app/[locale]/(real-estate-listings)/SectionGridFilterCard.tsx diff --git a/src/app/(real-estate-listings)/SectionGridHasMap.tsx b/src/app/[locale]/(real-estate-listings)/SectionGridHasMap.tsx similarity index 100% rename from src/app/(real-estate-listings)/SectionGridHasMap.tsx rename to src/app/[locale]/(real-estate-listings)/SectionGridHasMap.tsx diff --git a/src/app/(real-estate-listings)/TabFilters.tsx b/src/app/[locale]/(real-estate-listings)/TabFilters.tsx similarity index 100% rename from src/app/(real-estate-listings)/TabFilters.tsx rename to src/app/[locale]/(real-estate-listings)/TabFilters.tsx diff --git a/src/app/(real-estate-listings)/layout.tsx b/src/app/[locale]/(real-estate-listings)/layout.tsx similarity index 100% rename from src/app/(real-estate-listings)/layout.tsx rename to src/app/[locale]/(real-estate-listings)/layout.tsx diff --git a/src/app/(real-estate-listings)/listing-real-estate-map/page.tsx b/src/app/[locale]/(real-estate-listings)/listing-real-estate-map/page.tsx similarity index 100% rename from src/app/(real-estate-listings)/listing-real-estate-map/page.tsx rename to src/app/[locale]/(real-estate-listings)/listing-real-estate-map/page.tsx diff --git a/src/app/(real-estate-listings)/listing-real-estate/page.tsx b/src/app/[locale]/(real-estate-listings)/listing-real-estate/page.tsx similarity index 100% rename from src/app/(real-estate-listings)/listing-real-estate/page.tsx rename to src/app/[locale]/(real-estate-listings)/listing-real-estate/page.tsx diff --git a/src/app/(server-components)/SectionHero.tsx b/src/app/[locale]/(server-components)/SectionHero.tsx similarity index 78% rename from src/app/(server-components)/SectionHero.tsx rename to src/app/[locale]/(server-components)/SectionHero.tsx index bf81450..e9724dc 100644 --- a/src/app/(server-components)/SectionHero.tsx +++ b/src/app/[locale]/(server-components)/SectionHero.tsx @@ -1,14 +1,19 @@ +"use client" + import React, { FC } from "react"; import imagePng from "@/images/hero-right.png"; import HeroSearchForm from "../(client-components)/(HeroSearchForm)/HeroSearchForm"; import Image from "next/image"; import ButtonPrimary from "@/shared/ButtonPrimary"; +import { useTranslation } from "react-i18next"; // Import useTranslation export interface SectionHeroProps { className?: string; } const SectionHero: FC = ({ className = "" }) => { + const { t } = useTranslation("common"); // Initialize useTranslation + return (
= ({ className = "" }) => {

- Begin your spiritual adventure + {t("beginAdventure")} {/* Translate the heading */}

- Plan your pilgrimage with ease. Find the best accommodations, - transportation, and guided experiences to Shia shrines around the - world + {t("planPilgrimage")} {/* Translate the description */} - Start your journey + {t("startJourney")} {/* Translate the button text */}
diff --git a/src/app/(server-components)/SectionHero2.tsx b/src/app/[locale]/(server-components)/SectionHero2.tsx similarity index 100% rename from src/app/(server-components)/SectionHero2.tsx rename to src/app/[locale]/(server-components)/SectionHero2.tsx diff --git a/src/app/(server-components)/SectionHero3.tsx b/src/app/[locale]/(server-components)/SectionHero3.tsx similarity index 100% rename from src/app/(server-components)/SectionHero3.tsx rename to src/app/[locale]/(server-components)/SectionHero3.tsx diff --git a/src/app/(server-components)/SectionHeroArchivePage.tsx b/src/app/[locale]/(server-components)/SectionHeroArchivePage.tsx similarity index 100% rename from src/app/(server-components)/SectionHeroArchivePage.tsx rename to src/app/[locale]/(server-components)/SectionHeroArchivePage.tsx diff --git a/src/app/(stay-listings)/SectionGridFilterCard.tsx b/src/app/[locale]/(stay-listings)/SectionGridFilterCard.tsx similarity index 100% rename from src/app/(stay-listings)/SectionGridFilterCard.tsx rename to src/app/[locale]/(stay-listings)/SectionGridFilterCard.tsx diff --git a/src/app/(stay-listings)/SectionGridHasMap.tsx b/src/app/[locale]/(stay-listings)/SectionGridHasMap.tsx similarity index 100% rename from src/app/(stay-listings)/SectionGridHasMap.tsx rename to src/app/[locale]/(stay-listings)/SectionGridHasMap.tsx diff --git a/src/app/(stay-listings)/TabFilters.tsx b/src/app/[locale]/(stay-listings)/TabFilters.tsx similarity index 100% rename from src/app/(stay-listings)/TabFilters.tsx rename to src/app/[locale]/(stay-listings)/TabFilters.tsx diff --git a/src/app/(stay-listings)/layout.tsx b/src/app/[locale]/(stay-listings)/layout.tsx similarity index 100% rename from src/app/(stay-listings)/layout.tsx rename to src/app/[locale]/(stay-listings)/layout.tsx diff --git a/src/app/(stay-listings)/listing-stay-map/page.tsx b/src/app/[locale]/(stay-listings)/listing-stay-map/page.tsx similarity index 100% rename from src/app/(stay-listings)/listing-stay-map/page.tsx rename to src/app/[locale]/(stay-listings)/listing-stay-map/page.tsx diff --git a/src/app/(stay-listings)/listing-stay/page.tsx b/src/app/[locale]/(stay-listings)/listing-stay/page.tsx similarity index 100% rename from src/app/(stay-listings)/listing-stay/page.tsx rename to src/app/[locale]/(stay-listings)/listing-stay/page.tsx diff --git a/src/app/about/SectionFounder.tsx b/src/app/[locale]/about/SectionFounder.tsx similarity index 100% rename from src/app/about/SectionFounder.tsx rename to src/app/[locale]/about/SectionFounder.tsx diff --git a/src/app/about/SectionHero.tsx b/src/app/[locale]/about/SectionHero.tsx similarity index 100% rename from src/app/about/SectionHero.tsx rename to src/app/[locale]/about/SectionHero.tsx diff --git a/src/app/about/SectionStatistic.tsx b/src/app/[locale]/about/SectionStatistic.tsx similarity index 76% rename from src/app/about/SectionStatistic.tsx rename to src/app/[locale]/about/SectionStatistic.tsx index bd61cc7..ef73262 100644 --- a/src/app/about/SectionStatistic.tsx +++ b/src/app/[locale]/about/SectionStatistic.tsx @@ -1,5 +1,6 @@ import React, { FC } from "react"; import Heading from "@/shared/Heading"; +import { useTranslation } from "react-i18next"; // Import useTranslation export interface Statistic { id: string; @@ -32,13 +33,14 @@ export interface SectionStatisticProps { } const SectionStatistic: FC = ({ className = "" }) => { + const { t } = useTranslation("common"); // Initialize useTranslation with the "common" namespace + return (
- 🚀 Fast Facts + {t("statisticTitle")} {/* Translate title */}
{FOUNDER_DEMO.map((item) => ( @@ -47,10 +49,10 @@ const SectionStatistic: FC = ({ className = "" }) => { className="p-6 bg-neutral-50 dark:bg-neutral-800 rounded-2xl dark:border-neutral-800" >

- {item.heading} + {t(`statisticHeading${item.id}`)} {/* Translate each heading */}

- {item.subHeading} + {t(`statisticSubHeading${item.id}`)} {/* Translate each subheading */}
))} diff --git a/src/app/about/page.tsx b/src/app/[locale]/about/page.tsx similarity index 70% rename from src/app/about/page.tsx rename to src/app/[locale]/about/page.tsx index 8f85261..35d1a6e 100644 --- a/src/app/about/page.tsx +++ b/src/app/[locale]/about/page.tsx @@ -1,3 +1,4 @@ +"use client" import rightImg from "@/images/about-hero-right.png"; import React, { FC } from "react"; import SectionFounder from "./SectionFounder"; @@ -7,10 +8,13 @@ import BgGlassmorphism from "@/components/BgGlassmorphism"; import BackgroundSection from "@/components/BackgroundSection"; import SectionClientSay from "@/components/SectionClientSay"; import SectionSubscribe2 from "@/components/SectionSubscribe2"; +import { useTranslation } from "react-i18next"; // Import useTranslation export interface PageAboutProps {} -const PageAbout: FC = ({}) => { +const PageAbout: FC = () => { + const { t } = useTranslation("common"); // Initialize useTranslation with the "common" namespace + return (
{/* ======== BG GLASS ======== */} @@ -19,9 +23,9 @@ const PageAbout: FC = ({}) => {
{/* */} diff --git a/src/app/add-listing/FormItem.tsx b/src/app/[locale]/add-listing/FormItem.tsx similarity index 100% rename from src/app/add-listing/FormItem.tsx rename to src/app/[locale]/add-listing/FormItem.tsx diff --git a/src/app/add-listing/[[...stepIndex]]/PageAddListing1.tsx b/src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing1.tsx similarity index 99% rename from src/app/add-listing/[[...stepIndex]]/PageAddListing1.tsx rename to src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing1.tsx index ee9df59..1c85156 100644 --- a/src/app/add-listing/[[...stepIndex]]/PageAddListing1.tsx +++ b/src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing1.tsx @@ -4,7 +4,7 @@ import Input from "@/shared/Input"; import FormItem from "../FormItem"; import { IoPersonAddOutline } from "react-icons/io5"; import getImageURL from "@/components/api/getImageURL"; -import ConfirmModal from "../../../shared/popUp"; +import ConfirmModal from "@/shared/popUp"; import axiosInstance from "@/components/api/axios"; import { useUserContext } from "@/components/contexts/userContext"; import { useRouter } from "next/navigation"; diff --git a/src/app/add-listing/[[...stepIndex]]/PageAddListing10.tsx b/src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing10.tsx similarity index 100% rename from src/app/add-listing/[[...stepIndex]]/PageAddListing10.tsx rename to src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing10.tsx diff --git a/src/app/add-listing/[[...stepIndex]]/PageAddListing2.tsx b/src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing2.tsx similarity index 100% rename from src/app/add-listing/[[...stepIndex]]/PageAddListing2.tsx rename to src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing2.tsx diff --git a/src/app/add-listing/[[...stepIndex]]/PageAddListing3.tsx b/src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing3.tsx similarity index 100% rename from src/app/add-listing/[[...stepIndex]]/PageAddListing3.tsx rename to src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing3.tsx diff --git a/src/app/add-listing/[[...stepIndex]]/PageAddListing4.tsx b/src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing4.tsx similarity index 100% rename from src/app/add-listing/[[...stepIndex]]/PageAddListing4.tsx rename to src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing4.tsx diff --git a/src/app/add-listing/[[...stepIndex]]/PageAddListing5.tsx b/src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing5.tsx similarity index 100% rename from src/app/add-listing/[[...stepIndex]]/PageAddListing5.tsx rename to src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing5.tsx diff --git a/src/app/add-listing/[[...stepIndex]]/PageAddListing6.tsx b/src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing6.tsx similarity index 100% rename from src/app/add-listing/[[...stepIndex]]/PageAddListing6.tsx rename to src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing6.tsx diff --git a/src/app/add-listing/[[...stepIndex]]/PageAddListing7.tsx b/src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing7.tsx similarity index 100% rename from src/app/add-listing/[[...stepIndex]]/PageAddListing7.tsx rename to src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing7.tsx diff --git a/src/app/add-listing/[[...stepIndex]]/PageAddListing8.tsx b/src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing8.tsx similarity index 100% rename from src/app/add-listing/[[...stepIndex]]/PageAddListing8.tsx rename to src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing8.tsx diff --git a/src/app/add-listing/[[...stepIndex]]/PageAddListing9.tsx b/src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing9.tsx similarity index 100% rename from src/app/add-listing/[[...stepIndex]]/PageAddListing9.tsx rename to src/app/[locale]/add-listing/[[...stepIndex]]/PageAddListing9.tsx diff --git a/src/app/add-listing/[[...stepIndex]]/page.tsx b/src/app/[locale]/add-listing/[[...stepIndex]]/page.tsx similarity index 100% rename from src/app/add-listing/[[...stepIndex]]/page.tsx rename to src/app/[locale]/add-listing/[[...stepIndex]]/page.tsx diff --git a/src/app/add-new-passenger/page.tsx b/src/app/[locale]/add-new-passenger/page.tsx similarity index 100% rename from src/app/add-new-passenger/page.tsx rename to src/app/[locale]/add-new-passenger/page.tsx diff --git a/src/app/author/page.tsx b/src/app/[locale]/author/page.tsx similarity index 100% rename from src/app/author/page.tsx rename to src/app/[locale]/author/page.tsx diff --git a/src/app/blog/Card12.tsx b/src/app/[locale]/blog/Card12.tsx similarity index 100% rename from src/app/blog/Card12.tsx rename to src/app/[locale]/blog/Card12.tsx diff --git a/src/app/blog/Card13.tsx b/src/app/[locale]/blog/Card13.tsx similarity index 100% rename from src/app/blog/Card13.tsx rename to src/app/[locale]/blog/Card13.tsx diff --git a/src/app/blog/Card3.tsx b/src/app/[locale]/blog/Card3.tsx similarity index 100% rename from src/app/blog/Card3.tsx rename to src/app/[locale]/blog/Card3.tsx diff --git a/src/app/blog/Card3Small.tsx b/src/app/[locale]/blog/Card3Small.tsx similarity index 100% rename from src/app/blog/Card3Small.tsx rename to src/app/[locale]/blog/Card3Small.tsx diff --git a/src/app/blog/SectionAds.tsx b/src/app/[locale]/blog/SectionAds.tsx similarity index 100% rename from src/app/blog/SectionAds.tsx rename to src/app/[locale]/blog/SectionAds.tsx diff --git a/src/app/blog/SectionLatestPosts.tsx b/src/app/[locale]/blog/SectionLatestPosts.tsx similarity index 100% rename from src/app/blog/SectionLatestPosts.tsx rename to src/app/[locale]/blog/SectionLatestPosts.tsx diff --git a/src/app/blog/SectionMagazine5.tsx b/src/app/[locale]/blog/SectionMagazine5.tsx similarity index 100% rename from src/app/blog/SectionMagazine5.tsx rename to src/app/[locale]/blog/SectionMagazine5.tsx diff --git a/src/app/blog/WidgetCategories.tsx b/src/app/[locale]/blog/WidgetCategories.tsx similarity index 100% rename from src/app/blog/WidgetCategories.tsx rename to src/app/[locale]/blog/WidgetCategories.tsx diff --git a/src/app/blog/WidgetHeading1.tsx b/src/app/[locale]/blog/WidgetHeading1.tsx similarity index 100% rename from src/app/blog/WidgetHeading1.tsx rename to src/app/[locale]/blog/WidgetHeading1.tsx diff --git a/src/app/blog/WidgetPosts.tsx b/src/app/[locale]/blog/WidgetPosts.tsx similarity index 100% rename from src/app/blog/WidgetPosts.tsx rename to src/app/[locale]/blog/WidgetPosts.tsx diff --git a/src/app/blog/WidgetTags.tsx b/src/app/[locale]/blog/WidgetTags.tsx similarity index 100% rename from src/app/blog/WidgetTags.tsx rename to src/app/[locale]/blog/WidgetTags.tsx diff --git a/src/app/blog/[...slug]/Survey.tsx b/src/app/[locale]/blog/[...slug]/Survey.tsx similarity index 100% rename from src/app/blog/[...slug]/Survey.tsx rename to src/app/[locale]/blog/[...slug]/Survey.tsx diff --git a/src/app/blog/[...slug]/layout.tsx b/src/app/[locale]/blog/[...slug]/layout.tsx similarity index 100% rename from src/app/blog/[...slug]/layout.tsx rename to src/app/[locale]/blog/[...slug]/layout.tsx diff --git a/src/app/blog/[...slug]/page.tsx b/src/app/[locale]/blog/[...slug]/page.tsx similarity index 68% rename from src/app/blog/[...slug]/page.tsx rename to src/app/[locale]/blog/[...slug]/page.tsx index 0dfa701..6939db1 100644 --- a/src/app/blog/[...slug]/page.tsx +++ b/src/app/[locale]/blog/[...slug]/page.tsx @@ -17,6 +17,7 @@ import { Route } from "@/routers/types"; import { BiLike, BiDislike } from "react-icons/bi"; import Survey from "./Survey"; import axiosInstance from "@/components/api/axios"; +import { useTranslation } from "react-i18next"; // Import useTranslation const Page = ({ params, @@ -25,6 +26,7 @@ const Page = ({ params: { stepIndex: string }; searchParams?: { [key: string]: string | string[] | undefined }; }) => { + const { t } = useTranslation("common"); // Initialize useTranslation with the "common" namespace const [blog, setBlog] = useState(); const [posts, setPosts] = useState([]); @@ -39,51 +41,22 @@ const Page = ({ axiosInstance.get(`/api/blogs/${params.slug[0]}/`).then((response) => { setBlog(response.data); }); - }, []); + }, [params.slug]); + const renderHeader = () => { return (
- + {/* Translate badge name */}

{blog?.title}

- {/* - We’re an online magazine dedicated to covering the best in - international product design. We started as a little blog back in - 2002 covering student work and over time - */} -
- {/*
- -
- -
- - May 20, 2021 - - · - - 6 min read - -
-
-
*/} - {/*
- -
*/} + {/* Meta information can be added here */}
@@ -102,14 +75,12 @@ const Page = ({ }; const renderTags = () => { - console.log(blog?.tags[0].name); - return (
{blog?.tags.map((item) => ( {item.name} @@ -123,13 +94,13 @@ const Page = ({ return (

- Responses (14) + {t("responses", { count: 14 })} {/* Translate responses count */}