feat(SW-243): add translations

This commit is contained in:
Fredrik Thorsson
2024-08-21 14:25:05 +02:00
parent f4e63bedca
commit 5c357bc88b
8 changed files with 36 additions and 8 deletions

View File

@@ -12,7 +12,7 @@ import { StaySectionProps } from "@/types/components/hotelReservation/bookingCon
export default async function StaySection({ hotel, stay }: StaySectionProps) {
const intl = await getIntl()
const nights =
const nightsText =
stay.nights > 1
? intl.formatMessage({ id: "nights" })
: intl.formatMessage({ id: "night" })
@@ -39,7 +39,7 @@ export default async function StaySection({ hotel, stay }: StaySectionProps) {
</Caption>
</div>
<Body className={styles.stay}>
<span>{`${stay.nights} ${nights}`}</span>
<span>{`${stay.nights} ${nightsText}`}</span>
<span className={styles.dates}>
<span>{stay.start}</span>
<ArrowRightIcon height={15} width={15} />
@@ -54,8 +54,8 @@ export default async function StaySection({ hotel, stay }: StaySectionProps) {
{intl.formatMessage({ id: "Breakfast" })}
</Body>
<Caption className={styles.caption}>
<span>{`Mon-fri ${hotel.breakfast.start}-${hotel.breakfast.end}`}</span>
<span>{`Sat-sun ${hotel.breakfast.start}-${hotel.breakfast.end}`}</span>
<span>{`${intl.formatMessage({ id: "Weekdays" })} ${hotel.breakfast.start}-${hotel.breakfast.end}`}</span>
<span>{`${intl.formatMessage({ id: "Weekends" })} ${hotel.breakfast.start}-${hotel.breakfast.end}`}</span>
</Caption>
</div>
<div className={styles.checkIn}>

View File

@@ -8,6 +8,10 @@ import { SummarySectionProps } from "@/types/components/hotelReservation/booking
export default async function SummarySection({ summary }: SummarySectionProps) {
const intl = await getIntl()
const roomType = `${intl.formatMessage({ id: "Type of room" })}: ${summary.roomType}`
const bedType = `${intl.formatMessage({ id: "Type of bed" })}: ${summary.bedType}`
const breakfast = `${intl.formatMessage({ id: "Breakfast" })}: ${summary.breakfast}`
const flexibility = `${intl.formatMessage({ id: "Flexibility" })}: ${summary.flexibility}`
return (
<section className={styles.section}>
@@ -15,19 +19,19 @@ export default async function SummarySection({ summary }: SummarySectionProps) {
{intl.formatMessage({ id: "Summary" })}
</Title>
<Caption className={styles.summary}>
<span>{`Type of room: ${summary.roomType}`}</span>
<span>{roomType}</span>
<span>1648 SEK</span>
</Caption>
<Caption className={styles.summary}>
<span>{`Type of bed: ${summary.bedType}`}</span>
<span>{bedType}</span>
<span>0 SEK</span>
</Caption>
<Caption className={styles.summary}>
<span>{`Breakfast: ${summary.breakfast}`}</span>
<span>{breakfast}</span>
<span>198 SEK</span>
</Caption>
<Caption className={styles.summary}>
<span>{`Flexibility: ${summary.flexibility}`}</span>
<span>{flexibility}</span>
<span>200 SEK</span>
</Caption>
</section>