diff --git a/app/listings/[slug]/page.tsx b/app/listings/[slug]/page.tsx index 98d152e..baef3f8 100644 --- a/app/listings/[slug]/page.tsx +++ b/app/listings/[slug]/page.tsx @@ -77,7 +77,13 @@ export default async function ListingPage({ params }: ListingPageProps) { listing.hasFreeParking ? { icon: amenityIcons.parking, label: t('amenityFreeParking') } : null, ].filter(Boolean) as { icon: string; label: string }[]; const addressLine = `${listing.streetAddress ? `${listing.streetAddress}, ` : ''}${listing.city}, ${listing.region}, ${listing.country}`; - const capacityLine = `${t('capacityGuests', { count: listing.maxGuests })} · ${t('capacityBedrooms', { count: listing.bedrooms })} · ${t('capacityBeds', { count: listing.beds })} · ${t('capacityBathrooms', { count: listing.bathrooms })}`; + const capacityParts = [ + listing.maxGuests ? t('capacityGuests', { count: listing.maxGuests }) : null, + listing.bedrooms ? t('capacityBedrooms', { count: listing.bedrooms }) : null, + listing.beds ? t('capacityBeds', { count: listing.beds }) : null, + listing.bathrooms ? t('capacityBathrooms', { count: listing.bathrooms }) : null, + ].filter(Boolean) as string[]; + const capacityLine = capacityParts.length ? capacityParts.join(' · ') : t('capacityUnknown'); const contactLine = `${listing.contactName} · ${listing.contactEmail}${listing.contactPhone ? ` · ${listing.contactPhone}` : ''}`; const coverImage = listing.images.find((img) => img.isCover) ?? listing.images[0] ?? null; const priceLine = diff --git a/lib/i18n.ts b/lib/i18n.ts index 77642f5..f9a11fc 100644 --- a/lib/i18n.ts +++ b/lib/i18n.ts @@ -235,6 +235,7 @@ const baseMessages = { capacityBedrooms: '{count} bedrooms', capacityBeds: '{count} beds', capacityBathrooms: '{count} bathrooms', + capacityUnknown: 'Capacity not set', browseListingsTitle: 'Browse listings', browseListingsLead: 'Search public listings, filter by location, and explore them on the map.', sampleBadge: 'Sample', @@ -524,6 +525,7 @@ const baseMessages = { capacityBedrooms: '{count} makuuhuonetta', capacityBeds: '{count} vuodetta', capacityBathrooms: '{count} kylpyhuonetta', + capacityUnknown: 'Kapasiteettia ei ole asetettu', browseListingsTitle: 'Selaa kohteita', browseListingsLead: 'Hae julkaistuja kohteita, rajaa sijainnilla ja tutki kartalla.', sampleBadge: 'Mallikohde', @@ -638,6 +640,7 @@ const svMessages: Record = { priceWeekendShort: '{price}€ helg', priceNotSet: 'Ej angivet', listingPrices: 'Priser', + capacityUnknown: 'Kapacitet ej angiven', amenityEvAvailable: 'EV-laddning i närheten', amenitySkiPass: 'Liftkort ingår', amenityMicrowave: 'Mikrovågsugn',