From 295e98a56022ebd28e63347c5a76766c111f628e Mon Sep 17 00:00:00 2001 From: Bianca Widstam Date: Mon, 15 Sep 2025 10:43:57 +0000 Subject: [PATCH] Merged in fix/BOOK-127-translate-validation-text (pull request #2800) fix(BOOK-127): translate terms required message * fix(BOOK-127): translate terms required message Approved-by: Erik Tiekstra --- .../Payment/TermsAndConditions/index.tsx | 13 ++++++++++++- .../lib/components/EnterDetails/Payment/schema.ts | 10 +++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/packages/booking-flow/lib/components/EnterDetails/Payment/TermsAndConditions/index.tsx b/packages/booking-flow/lib/components/EnterDetails/Payment/TermsAndConditions/index.tsx index 310452757..83677b7d9 100644 --- a/packages/booking-flow/lib/components/EnterDetails/Payment/TermsAndConditions/index.tsx +++ b/packages/booking-flow/lib/components/EnterDetails/Payment/TermsAndConditions/index.tsx @@ -8,6 +8,7 @@ import Link from "@scandic-hotels/design-system/Link" import { Typography } from "@scandic-hotels/design-system/Typography" import useLang from "../../../../hooks/useLang" +import { paymentError } from "../schema" import styles from "../payment.module.css" @@ -89,7 +90,17 @@ export default function TermsAndConditions({ } )} - + {intl.formatMessage({ diff --git a/packages/booking-flow/lib/components/EnterDetails/Payment/schema.ts b/packages/booking-flow/lib/components/EnterDetails/Payment/schema.ts index 5a70018ac..2b97f78d7 100644 --- a/packages/booking-flow/lib/components/EnterDetails/Payment/schema.ts +++ b/packages/booking-flow/lib/components/EnterDetails/Payment/schema.ts @@ -1,11 +1,15 @@ import { z } from "zod" +export enum paymentError { + TERMS_REQUIRED = "TERMS_REQUIRED", +} + export const paymentSchema = z.object({ paymentMethod: z.string().nullish(), smsConfirmation: z.boolean(), - termsAndConditions: z.boolean().refine((value) => value === true, { - message: "You must accept the terms and conditions", - }), + termsAndConditions: z + .boolean() + .refine((value) => value === true, paymentError.TERMS_REQUIRED), guarantee: z.boolean(), })