added translation for product page

This commit is contained in:
Laura Dolibois
2025-05-25 13:55:56 +02:00
parent 812d21087b
commit 419554748f
3 changed files with 10 additions and 3 deletions

View File

@@ -25,6 +25,8 @@
"outOfStock": "Ausverkauft",
"pageDoesNotExist": "Ups! Diese Seite existiert nicht.",
"phone": "Telefon",
"productDoesNotExist": "Dieses Produkt existiert nicht oder wurde bereits gelöscht.",
"productNotFound": "Produkt nicht gefunden!",
"quantity": "Anzahl",
"rateThisProduct": "Dieses Produkt bewerten",
"ratingFrom": "Bewertung vom",

View File

@@ -25,6 +25,8 @@
"outOfStock": "Out of stock",
"pageDoesNotExist": "Oops! The page you're looking for doesn't exist.",
"phone": "Phone number",
"productDoesNotExist": "It seems you are locking for a product that doesn't exist or has been removed.",
"productNotFound": "Product not found!",
"quantity": "Quantity",
"rateThisProduct": "Rate this product",
"ratingFrom": "Rating from",

View File

@@ -9,9 +9,12 @@ import { useLocation, useNavigate } from 'react-router-dom';
import Item from '../components/Item';
import ProductInfo from '../helper/productpage/ProductInfo';
import Ratings from '../helper/productpage/Ratings';
import {useTranslation} from "react-i18next";
export default function Product() {
const { t } = useTranslation();
const location = useLocation();
const item = location.state?.item as Item;
const navigate = useNavigate();
@@ -25,10 +28,10 @@ export default function Product() {
return (
<Box className="no-page-container">
<Typography variant="h1" className="no-page-title">
Product not found
{t('productNotFound')}
</Typography>
<Typography variant="h5" className="no-page-description">
It seems you are locking for a product that doesn't exist or has been removed.
{t('productDoesNotExist')}
</Typography>
<Button
variant="contained"
@@ -37,7 +40,7 @@ export default function Product() {
className="no-page-button"
onClick={handleGoHome}
>
Go Back to Home
{t('backToHome')}
</Button>
</Box>
);