- Доставка: {totalPrice && (totalPrice > MAX_TOTAL_PRICE) ? FREE_DELIVERY : deliveryPrice}
- ₴
+ {t('cartDelivery.deliveryLabel')} {totalPrice && (totalPrice > MAX_TOTAL_PRICE) ? FREE_DELIVERY.toLocaleString('fa-IR') : deliveryPrice.toLocaleString('fa-IR')}
+ {t('currencySymbol')}
-
@@ -46,7 +48,7 @@ function CartDelivery({ className, totalPrice }) {
colorScheme='green'
fontWeight='normal'
size={{ xs: "sm", sm: "sm", md: "md", lg: "md" }}>
- Условия доставки
+ {t('cartDelivery.conditionsButton')}
- Условия доставки
+ {t('cartDelivery.drawerHeader')}
- Мебельный магазин MEBL осуществляет доставку мебели по всей Украине. Мы работаем с ведущими транспортными компаниями: Новая Почта, Мист-Экспресс, Cat, что позволяет нам гарантировать оперативную и безопасную доставку ваших заказов.
- Стандартная стоимость доставки
- Стандартная стоимость доставки мебели по Украине составляет 1000 гривен. Стоимость доставки рассчитывается исходя из габаритов и веса мебели, а также расстояния от нашего склада до вашего населенного пункта
- Бесплатная доставка
- Доставка мебели бесплатна при сумме заказа более 9999 гривен
- Сроки доставки
- Сроки доставки мебели зависят от удаленности вашего населенного пункта и загруженности транспортных компаний. В среднем, доставка мебели по Украине занимает от 1 до 5 дней.
- Варианты доставки
- Мы предлагаем следующие варианты доставки мебели:
+ {t('cartDelivery.drawerBody.paragraph1')}
+ {t('cartDelivery.drawerBody.standardCostHeader')}
+
+ {t('cartDelivery.drawerBody.freeDeliveryHeader')}
+ {t('cartDelivery.drawerBody.freeDeliveryParagraph', { currencyName: t('currencyNamePlural') })}
+ {t('cartDelivery.drawerBody.deliveryTimesHeader')}
+ {t('cartDelivery.drawerBody.deliveryTimesParagraph')}
+ {t('cartDelivery.drawerBody.deliveryOptionsHeader')}
+ {t('cartDelivery.drawerBody.deliveryOptionsParagraph')}
- - Доставка на склад транспортной компании.
- - Доставка по адресу курьером.
- - Доставка и сборка мебели специалистом нашей компании (только Киев).
- - Самовывоз со склада.
+ - {t('cartDelivery.drawerBody.option1')}
+ - {t('cartDelivery.drawerBody.option2')}
+ - {t('cartDelivery.drawerBody.option3')}
+ - {t('cartDelivery.drawerBody.option4')}
diff --git a/src/components/CartDelivery/CartDelivery.module.scss b/src/components/CartDelivery/CartDelivery.module.scss
index 91b84a3..728755f 100644
--- a/src/components/CartDelivery/CartDelivery.module.scss
+++ b/src/components/CartDelivery/CartDelivery.module.scss
@@ -28,7 +28,7 @@
}
& ul {
- margin-left: 2rem;
+ margin-inline-start: 2rem; /* Replaces margin-left */
padding-block: 1rem;
list-style: disc;
// line-height: 1.4;
diff --git a/src/components/CartForm/CartForm.jsx b/src/components/CartForm/CartForm.jsx
index 5b7ac3f..5f84cfa 100644
--- a/src/components/CartForm/CartForm.jsx
+++ b/src/components/CartForm/CartForm.jsx
@@ -9,11 +9,12 @@ import { useDispatch, useSelector } from "react-redux";
import { useNavigate } from "react-router-dom";
import { fetchOrder } from "../../store/order/order.slice";
import { useEffect, useState } from "react";
-// import { fetchCart } from "../../store/cart/cart.slice";
+import { useTranslation } from 'react-i18next'; // Import useTranslation
function CartForm() {
+ const { t } = useTranslation(); // Initialize useTranslation
const { isOpen, onToggle } = useDisclosure();
- const [isChecked, setIsChecked] = useState(true);
+ const [isChecked, setIsChecked] = useState(true); // This state seems to be used for both delivery and payment, which might not be intended. Assuming it's for the default checked state.
const navigate = useNavigate();
const dispatch = useDispatch();
const orderStatus = useSelector((state) => state.order);
@@ -27,7 +28,7 @@ function CartForm() {
const toast = useToast();
const orderToast = () => {
toast({
- description: "Ваш заказ добавлен в обработку",
+ description: t('cartForm.orderToastMessage'), // Use t function
position: "top",
status: "success",
variant: "solid",
@@ -52,65 +53,65 @@ function CartForm() {
return (
diff --git a/src/components/CartForm/CartForm.module.scss b/src/components/CartForm/CartForm.module.scss
index 7605c72..7f8dd1f 100644
--- a/src/components/CartForm/CartForm.module.scss
+++ b/src/components/CartForm/CartForm.module.scss
@@ -130,7 +130,7 @@
display: flex;
align-items: center;
margin-bottom: 8px;
- padding-left: 1rem;
+ padding-inline-start: 1rem; /* Replaces padding-left */
font-size: 16px;
line-height: 24px;
@@ -149,7 +149,7 @@
-moz-appearance: none;
appearance: none;
padding: 2px;
- margin-right: 8px;
+ margin-inline-end: 8px; /* Replaces margin-right */
&:before {
content: "";
diff --git a/src/components/CartPlace/CartPlace.jsx b/src/components/CartPlace/CartPlace.jsx
index f6aa252..31d9fd4 100644
--- a/src/components/CartPlace/CartPlace.jsx
+++ b/src/components/CartPlace/CartPlace.jsx
@@ -1,25 +1,24 @@
import { useSelector } from "react-redux";
-import { getDeclOfNum, titles } from "../../helpers/getDeclOfNum";
import s from "./CartPlace.module.scss";
import { Spinner } from "@chakra-ui/react";
import CartDelivery from "../CartDelivery/CartDelivery";
+import { useTranslation } from 'react-i18next'; // Import useTranslation
function CartPlace() {
+ const { t } = useTranslation(); // Initialize useTranslation
const { products, totalPrice, totalCount, loadingFetch: loading } = useSelector((state) => state.cart);
const countAllQuantity = (data) => data.reduce((sum, item) => sum + item.quantity, 0);
const allQuantity = countAllQuantity(products);
- const items = ["единици", "единицы", "единиц"];
-
return (
-
Оформление заказа:
+
{t('cartPlace.title')}
-
{getDeclOfNum(totalCount, titles)} на сумму:
+
{t('cartPlace.product', { count: totalCount })} {t('cartPlace.forTheAmountOf')}
{allQuantity > totalCount ? (
-
(всего: {getDeclOfNum(allQuantity, items)} мебели)
+
({t('cartPlace.total')} {t('cartPlace.unit', { count: allQuantity })} {t('cartPlace.piecesOfFurniture')})
) : <>>}
@@ -32,11 +31,11 @@ function CartPlace() {
color='green.300'
size={{ xs: "xs", sm: "sm", md: "sm", lg: "md" }}
/>) :
- totalPrice.toLocaleString())
- } ₴
+ totalPrice.toLocaleString('fa-IR'))
+ }
{t('currencySymbol')}
-
+
);
}
diff --git a/src/components/CartPlace/CartPlace.module.scss b/src/components/CartPlace/CartPlace.module.scss
index f88992f..49506b4 100644
--- a/src/components/CartPlace/CartPlace.module.scss
+++ b/src/components/CartPlace/CartPlace.module.scss
@@ -116,7 +116,7 @@
content: '';
position: absolute;
bottom: 0;
- left: 0;
+ left: 0; // LTR default
width: 100%;
height: 100%;
background-color: var(--color-mebl-dark);
@@ -127,7 +127,7 @@
content: '';
position: absolute;
bottom: 0;
- left: 0;
+ left: 0; // LTR default
width: 0%;
height: 100%;
background-color: var(--color-mebl);
@@ -141,4 +141,15 @@
width: 100%;
}
}
+}
+
+[dir="rtl"] .placeBtnPro {
+ &:after {
+ left: auto;
+ right: 0;
+ }
+ &:before {
+ left: auto;
+ right: 0;
+ }
}
\ No newline at end of file
diff --git a/src/components/CartProducts/CartProducts.jsx b/src/components/CartProducts/CartProducts.jsx
index 63be356..9f5b60c 100644
--- a/src/components/CartProducts/CartProducts.jsx
+++ b/src/components/CartProducts/CartProducts.jsx
@@ -6,8 +6,10 @@ import CartQuantityCounter from "../CartQuantityCounter/CartQuantityCounter";
import { useSelector } from "react-redux";
import emptyCart from "../../assets/emptycart.svg";
import { Center, Spinner } from "@chakra-ui/react";
+import { useTranslation } from 'react-i18next'; // Import useTranslation
function CartProducts() {
+ const { t } = useTranslation(); // Initialize useTranslation
const {
products,
loadingFetch: loading
@@ -32,10 +34,10 @@ function CartProducts() {
{(products?.length === 0) && !loading ?
(<>
-
Уважаемый покупатель, в вашей корзине сейчас пусто..
-
Пожалуйста перейдите в каталог, и выберите какой-нибудь товар.
+
{t('cartProducts.dearCustomer')}, {t('cartProducts.emptyCartMessage')}
+
{t('cartProducts.pleaseGoTo')} {t('cartProducts.catalogLink')}{t('cartProducts.andSelectProduct')}
-

+
>) :
@@ -52,17 +54,17 @@ function CartProducts() {
арт. {item.article || "0"}
+