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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user