feat: enhance language support in data fetching across components

- Updated Content, ProductDetailPage, and GrowTentKonfigurator to include current language context when emitting WebSocket requests for product and category data.
- Improved caching logic to ensure fresh data loading based on language changes.
- Enhanced localization by adding language parameters to data requests, improving user experience across different languages.
This commit is contained in:
sebseb7
2025-08-09 10:06:43 +02:00
parent d40e311b51
commit 2ac9baada0
3 changed files with 16 additions and 14 deletions

View File

@@ -151,7 +151,10 @@ class GrowTentKonfigurator extends Component {
setCachedCategoryData(categoryId, response);
});
window.socketManager.emit("getCategoryProducts", { categoryId: categoryId },
const currentLanguage = this.props.languageContext?.currentLanguage || this.props.i18n?.language || 'de';
window.socketManager.emit(
"getCategoryProducts",
{ categoryId: categoryId, language: currentLanguage, requestTranslation: currentLanguage === 'de' ? false : true },
(response) => {
console.log("getCategoryProducts stub response", response);
}