diff --git a/lib/model/decorators/hypnos-public-decorator.ts b/lib/model/decorators/hypnos-public-decorator.ts index f27d44b9..7e60cd36 100644 --- a/lib/model/decorators/hypnos-public-decorator.ts +++ b/lib/model/decorators/hypnos-public-decorator.ts @@ -5,11 +5,15 @@ import type { ICard } from '@dreampipcom/oneiros'; /* private */ const decorateListing = (listing: Record, uMeta: any, locale?: string): ICard => { + const coerceStringLocale = (localeString: any) => { + const locArr = locale?.split('-') || []; + return localeString[locArr[1]] || localeString[locArr[0]]; + }; const decd: ICard = { id: `${listing.id}`, className: '', - title: `${listing?.title[locale || 'en']}`, - description: `${listing?.description[locale || 'en']}`, + title: `${coerceStringLocale(listing?.title)}`, + description: `${coerceStringLocale(listing?.description)}`, where: `${listing?.location?.name}`, latlng: `${listing?.location?.geo}`, when: `${listing?.scheduledFor}`,