Skip to content

Commit

Permalink
Merge pull request #51 from dreampipcom/dev
Browse files Browse the repository at this point in the history
r004
  • Loading branch information
angeloreale authored Aug 30, 2024
2 parents ce281d4 + ef27673 commit e0256f1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/model/decorators/hypnos-public-decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ import type { ICard } from '@dreampipcom/oneiros';

/* private */
const decorateListing = (listing: Record<string, any>, 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}`,
Expand Down

0 comments on commit e0256f1

Please sign in to comment.