From 9c8dc1b92cf70c842d9951046a3c304b3e57a5e7 Mon Sep 17 00:00:00 2001 From: Nafees Nazik <84864519+G3root@users.noreply.github.com> Date: Sun, 13 Aug 2023 03:01:43 +0530 Subject: [PATCH] fix: link escaping in booking page (#10360) Co-authored-by: Hariom Balhara --- packages/features/bookings/lib/getLocationOptionsForSelect.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/features/bookings/lib/getLocationOptionsForSelect.ts b/packages/features/bookings/lib/getLocationOptionsForSelect.ts index 1b1ea7e2f4..7e14f67dfc 100644 --- a/packages/features/bookings/lib/getLocationOptionsForSelect.ts +++ b/packages/features/bookings/lib/getLocationOptionsForSelect.ts @@ -20,7 +20,9 @@ export default function getLocationsOptionsForSelect( const type = eventLocation.type; return { - label: t(locationString), + // XYZ: is considered a namespace in i18next https://www.i18next.com/principles/namespaces and thus it get's cleaned up. + // Beacause there can be a URL in here, simply don't translate it if it starts with http: or https:. This would allow us to keep supporting namespaces if we plan to use them + label: locationString.search(/^https?:/) !== -1 ? locationString : t(locationString), value: type, inputPlaceholder: t(eventLocation?.attendeeInputPlaceholder || ""), };