feat: Add new virtual categories 'bald' and 'neu', update category handling in renderApp, and enhance translations across multiple locales

This commit is contained in:
sebseb7
2026-03-25 07:04:50 +01:00
parent e5a3b7bcce
commit 0ce8ce3626
27 changed files with 144 additions and 8 deletions

View File

@@ -341,6 +341,9 @@ class Content extends Component {
fetchCategoryData(categoryId) {
if (categoryId === 'bald') {
sessionStorage.setItem('filter_availability', '1');
}
const currentLanguage = this.props.languageContext?.currentLanguage || this.props.i18n?.language || 'de';
const cachedData = getCachedCategoryData(categoryId, currentLanguage);
if (cachedData) {
@@ -431,6 +434,18 @@ class Content extends Component {
} catch (err) {
console.error('Error finding category name in tree:', err);
}
if (!enhancedResponse.categoryName && !enhancedResponse.name) {
if (categoryId === 'neu') {
enhancedResponse.categoryName = this.props.t
? this.props.t('navigation.new')
: 'Neuheiten';
} else if (categoryId === 'bald') {
enhancedResponse.categoryName = this.props.t
? this.props.t('navigation.soon')
: 'Demnächst';
}
}
}
this.processData(enhancedResponse);