Files
web/apps/scandic-web/components/TempDesignSystem/MeetingRoomCard/utils.ts
Joakim Jäderberg aafad9781f Merged in feat/lokalise-rebuild (pull request #2993)
Feat/lokalise rebuild

* chore(lokalise): update translation ids

* chore(lokalise): easier to switch between projects

* chore(lokalise): update translation ids

* .

* .

* .

* .

* .

* .

* chore(lokalise): update translation ids

* chore(lokalise): update translation ids

* .

* .

* .

* chore(lokalise): update translation ids

* chore(lokalise): update translation ids

* .

* .

* chore(lokalise): update translation ids

* chore(lokalise): update translation ids

* chore(lokalise): new translations

* merge

* switch to errors for missing id's

* merge

* sync translations


Approved-by: Linus Flood
2025-10-22 11:00:03 +00:00

103 lines
3.4 KiB
TypeScript

import { logger } from "@scandic-hotels/common/logger"
import type { IntlShape } from "react-intl/src/types"
import { RoomLighting, SeatingType } from "@/types/enums/meetingRooms"
export function translateRoomLighting(option: string, intl: IntlShape) {
switch (option) {
case RoomLighting.WindowsNaturalDaylight:
return intl.formatMessage({
id: "meetingRoomCard.windowsNaturalDaylight",
defaultMessage: "Windows with natural daylight",
})
case RoomLighting.IndoorWindowsExcellentLighting:
return intl.formatMessage({
id: "meetingRoomCard.indoorWindowsExcellentLighting",
defaultMessage: "Indoor windows and excellent lighting",
})
case RoomLighting.IndoorWindows:
return intl.formatMessage({
id: "meetingRoomCard.indoorWindows",
defaultMessage: "Indoor windows facing the hotel",
})
case RoomLighting.NoWindows:
return intl.formatMessage({
id: "meetingRoomCard.noWindows",
defaultMessage: "No windows",
})
case RoomLighting.NoWindowsExcellentLighting:
return intl.formatMessage({
id: "meetingRoomCard.noWindowsExcellentLighting",
defaultMessage: "No windows but excellent lighting",
})
case RoomLighting.WindowsNaturalDaylightBlackoutFacilities:
return intl.formatMessage({
id: "meetingRoomCard.windowsNaturalDaylightBlackoutFacilities",
defaultMessage: "Windows natural daylight and blackout facilities",
})
case RoomLighting.WindowsNaturalDaylightExcellentView:
return intl.formatMessage({
id: "meetingRoomCard.windowsNaturalDaylightExcellentView",
defaultMessage: "Windows natural daylight and excellent view",
})
default:
logger.warn(`Unsupported conference room ligthing option: ${option}`)
return intl.formatMessage({
id: "common.NA",
defaultMessage: "N/A",
})
}
}
export function translateSeatingType(type: string, intl: IntlShape) {
switch (type) {
case SeatingType.Boardroom:
return intl.formatMessage({
id: "meetingRoomCard.boardroom",
defaultMessage: "Boardroom",
})
case SeatingType.Cabaret:
return intl.formatMessage({
id: "meetingRoomCard.cabaret",
defaultMessage: "Cabaret seating",
})
case SeatingType.Classroom:
return intl.formatMessage({
id: "meetingRoomCard.classroom",
defaultMessage: "Classroom",
})
case SeatingType.FullCircleTable:
return intl.formatMessage({
id: "meetingRoomCard.fullCircleTable",
defaultMessage: "Full circle",
})
case SeatingType.HalfCircle:
return intl.formatMessage({
id: "meetingRoomCard.halfCircle",
defaultMessage: "Half circle",
})
case SeatingType.StandingTable:
return intl.formatMessage({
id: "meetingRoomCard.standingTable",
defaultMessage: "Standing table",
})
case SeatingType.Theatre:
return intl.formatMessage({
id: "meetingRoomCard.theatre",
defaultMessage: "Theatre",
})
case SeatingType.UShape:
return intl.formatMessage({
id: "meetingRoomCard.uShape",
defaultMessage: "U-shape",
})
default:
logger.warn(`Unsupported conference room type : ${type}`)
return intl.formatMessage({
id: "common.NA",
defaultMessage: "N/A",
})
}
}