Merged in fix/SW-2425-filter-label-lokalise (pull request #2602)

fix(SW-2425): filter description should be translated with lokalise

* fix(SW-2425): filter description should be translated with lokalise


Approved-by: Anton Gunnarsson
This commit is contained in:
Bianca Widstam
2025-08-06 14:09:32 +00:00
parent 4b3d59f75b
commit 9f4e2b3c45
7 changed files with 58 additions and 6 deletions

View File

@@ -0,0 +1,23 @@
import { RoomPackageCodeEnum } from "@scandic-hotels/trpc/enums/roomFilter"
import type { IntlShape } from "react-intl"
export function getFeatureDescription(
code: string,
description: string,
intl: IntlShape
): string {
const roomFeatureDescriptions: Record<string, string> = {
[RoomPackageCodeEnum.ACCESSIBILITY_ROOM]: intl.formatMessage({
defaultMessage: "Accessible room",
}),
[RoomPackageCodeEnum.ALLERGY_ROOM]: intl.formatMessage({
defaultMessage: "Allergy-friendly room",
}),
[RoomPackageCodeEnum.PET_ROOM]: intl.formatMessage({
defaultMessage: "Pet-friendly room",
}),
}
return roomFeatureDescriptions[code] ?? description
}