Integrate i18n support across multiple components: Update AddToCartButton, CartDropdown, CartItem, Footer, ProductFilters, ProductList, and profile components to utilize translation functions for dynamic text rendering. Enhance user experience by providing localized content for various UI elements, including buttons, labels, and tax information.

This commit is contained in:
sebseb7
2025-07-16 03:03:47 +02:00
parent cff9c88808
commit 5c90d048fb
12 changed files with 122 additions and 59 deletions

View File

@@ -10,6 +10,7 @@ import AddIcon from "@mui/icons-material/Add";
import RemoveIcon from "@mui/icons-material/Remove";
import ShoppingCartIcon from "@mui/icons-material/ShoppingCart";
import DeleteIcon from "@mui/icons-material/Delete";
import { withI18n } from "../i18n/withTranslation.js";
if (!Array.isArray(window.cart)) window.cart = [];
@@ -184,7 +185,9 @@ class AddToCartButton extends Component {
},
}}
>
{this.props.steckling ? "Als Steckling vorbestellen" : "In den Korb"}
{this.props.steckling ?
(this.props.t ? this.props.t('cart.preorderCutting') : "Als Steckling vorbestellen") :
(this.props.t ? this.props.t('cart.addToCart') : "In den Korb")}
</Button>
);
}
@@ -330,7 +333,9 @@ class AddToCartButton extends Component {
},
}}
>
{this.props.steckling ? "Als Steckling vorbestellen" : "In den Korb"}
{this.props.steckling ?
(this.props.t ? this.props.t('cart.preorderCutting') : "Als Steckling vorbestellen") :
(this.props.t ? this.props.t('cart.addToCart') : "In den Korb")}
</Button>
);
}
@@ -439,4 +444,4 @@ class AddToCartButton extends Component {
}
}
export default AddToCartButton;
export default withI18n()(AddToCartButton);