From 118daf7cc06647cb0cee833d33ac553ffec3dc30 Mon Sep 17 00:00:00 2001 From: Mahyar Khanbolooki Date: Wed, 30 Jul 2025 01:10:14 +0330 Subject: [PATCH] add: cart page locale --- src/app/[name]/cart/page.tsx | 45 +++++++++++++--------- src/components/navigation/BottomNavBar.tsx | 2 +- src/locales/fa/parallels.json | 11 ++++++ 3 files changed, 38 insertions(+), 20 deletions(-) diff --git a/src/app/[name]/cart/page.tsx b/src/app/[name]/cart/page.tsx index c73c94f..7dcd521 100644 --- a/src/app/[name]/cart/page.tsx +++ b/src/app/[name]/cart/page.tsx @@ -1,17 +1,20 @@ 'use client'; import Button from '@/components/button/PrimaryButton'; -import { ScrollArea } from '@/components/ui/scrollarea'; import { useReceiptStore } from '@/zustand/receiptStore'; import { motion } from 'framer-motion'; import { ArrowLeft, Trash } from 'iconsax-react'; import { PlusIcon, MinusIcon } from 'lucide-react'; import { useRouter } from 'next/navigation'; import React from 'react' +import { useTranslation } from 'react-i18next'; type Props = object const CartIndex = ({ }: Props) => { + const { t } = useTranslation('parallels', { + keyPrefix: 'Cart' + }); const router = useRouter(); const quantity = useReceiptStore(state => state.items[0]?.quantity || 0); const increment = useReceiptStore(state => state.increment); @@ -22,18 +25,18 @@ const CartIndex = ({ }: Props) => {

{ router.back() }} - /> - سبد خرید + className='cursor-pointer' + size='24' + color='currentColor' + onClick={() => { router.back() }} + /> + {t('Heading')} { router.back() }} - /> + className='cursor-pointer' + size='24' + color='currentColor' + onClick={() => { router.back() }} + />

@@ -91,12 +94,14 @@ const CartIndex = ({ }: Props) => {
-

توضیحات:

+

+ {t('InputDescription.Label')} +

@@ -106,10 +111,12 @@ const CartIndex = ({ }: Props) => {
-
جمع خرید:
-
560.000 تومان
+
{t('SumOfItemsLabel')}
+
{t('SumOfItemsValue').replace('{price}', '560.000')}
- +
diff --git a/src/components/navigation/BottomNavBar.tsx b/src/components/navigation/BottomNavBar.tsx index e4d8c5c..14bea8d 100644 --- a/src/components/navigation/BottomNavBar.tsx +++ b/src/components/navigation/BottomNavBar.tsx @@ -42,7 +42,7 @@ function BottomNavBar() {