--- import { getCollection } from 'astro:content'; import { t, getPhotoBlogPath, getPhotoAlbumsPath, type Locale } from '../../utils/i18n'; interface Props { lang?: Locale; } const { lang = 'fr' } = Astro.props; // Récupérer les catégories filtrées par langue const allCategories = await getCollection('photoCategories'); const langCategories = allCategories.filter(c => (c.data.lang ?? 'fr') === lang); const effectiveCategories = langCategories.length > 0 ? langCategories : allCategories.filter(c => (c.data.lang ?? 'fr') === 'fr'); const sortedCategories = effectiveCategories.sort((a, b) => (a.data.order || 99) - (b.data.order || 99)); --- {t('photo', 'categories', lang)} {t('photo', 'browseByTheme', lang)} {sortedCategories.map(cat => ( {cat.data.title} ))} {t('photo', 'photoFeed', lang)} {t('photo', 'feedDescription', lang)} {t('photo', 'viewFeed', lang)}
{t('photo', 'browseByTheme', lang)}
{t('photo', 'feedDescription', lang)}