From b9ee1a892e1984e00ef85a99e61835a852955bec Mon Sep 17 00:00:00 2001 From: Mahyar Khanbolooki Date: Sun, 27 Jul 2025 17:42:26 +0330 Subject: [PATCH] add: rating page locale --- src/app/[name]/rating/[orderId]/page.tsx | 72 ++++++++---------------- src/app/layout.tsx | 2 +- src/locales/fa/rating.json | 33 +++++++++++ 3 files changed, 59 insertions(+), 48 deletions(-) create mode 100644 src/locales/fa/rating.json diff --git a/src/app/[name]/rating/[orderId]/page.tsx b/src/app/[name]/rating/[orderId]/page.tsx index 1854498..833b464 100644 --- a/src/app/[name]/rating/[orderId]/page.tsx +++ b/src/app/[name]/rating/[orderId]/page.tsx @@ -8,6 +8,7 @@ import RateSelectionBar from '@/components/utils/RateSelectionBar'; import clsx from 'clsx'; import { useParams } from 'next/navigation'; import React from 'react' +import { useTranslation } from 'react-i18next'; type Props = object @@ -17,30 +18,18 @@ type Params = { function RatingOrderIndex({ }: Props) { const params: Params = useParams(); - console.log(params) + console.log(params); + const { t } = useTranslation("rating"); const badPoitns = () => { return ( <>
- - اماده سازی زمانبر - - - بهداشت محیطی بد - - - کیفیت منو پایین - - - تنوع پایین منو - - - برخورد نامناسب کارکنان - - - قیمت نامناسب - + {[...Array(6)].map((_, i) => ( + + {t(`Tabs.Weeknesses.Options.${i}`)} + + ))}
) @@ -49,28 +38,13 @@ function RatingOrderIndex({ }: Props) { const goodPoitns = () => { return ( <> -
- - اماده سازی سریع - - - بهداشت محیطی خوب - - - کیفیت منو خوب - - - تنوع بالا منو - - - برخورد مناسب کارکنان - - - قیمت مناسب - + {[...Array(6)].map((_, i) => ( + + {t(`Tabs.Strengths.Options.${i}`)} + + ))}
- ) } @@ -81,13 +55,13 @@ function RatingOrderIndex({ }: Props) { return (
-

امتیاز شما به رستوران

+

{t("Heading")}

- +
@@ -105,20 +79,24 @@ function RatingOrderIndex({ }: Props) { headerActive: 'bg-primary', titleActive: 'text-accent' }}> - - + +
- +
-