From 42766b42c0ac7abb93e8cd7145b84ffdf0cd3b40 Mon Sep 17 00:00:00 2001 From: Marlo Kesser <48910761+marlokessler@users.noreply.github.com> Date: Wed, 4 Jan 2023 16:31:50 +0100 Subject: [PATCH] fix localization issues with default locations (#5569) --- apps/web/components/booking/AvailableEventLocations.tsx | 7 +++++-- apps/web/components/booking/pages/BookingPage.tsx | 4 ++-- apps/web/components/eventtype/EventSetupTab.tsx | 4 ++-- apps/web/public/static/locales/de/common.json | 7 +++++-- apps/web/public/static/locales/en/common.json | 3 +++ packages/app-store/locations.ts | 4 ++-- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/apps/web/components/booking/AvailableEventLocations.tsx b/apps/web/components/booking/AvailableEventLocations.tsx index b7f8e4f8f7..9c05ee7dc5 100644 --- a/apps/web/components/booking/AvailableEventLocations.tsx +++ b/apps/web/components/booking/AvailableEventLocations.tsx @@ -1,10 +1,13 @@ import { getEventLocationType, locationKeyToString } from "@calcom/app-store/locations"; import { classNames } from "@calcom/lib"; +import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Icon, Tooltip } from "@calcom/ui"; import { Props } from "./pages/AvailabilityPage"; export function AvailableEventLocations({ locations }: { locations: Props["eventType"]["locations"] }) { + const { t } = useLocale(); + return locations.length ? (
{locations.map((location) => { @@ -27,8 +30,8 @@ export function AvailableEventLocations({ locations }: { locations: Props["event alt={`${eventLocationType.label} icon`} /> )} - -

{locationKeyToString(location)}

+ +

{t(locationKeyToString(location) ?? "")}

); diff --git a/apps/web/components/booking/pages/BookingPage.tsx b/apps/web/components/booking/pages/BookingPage.tsx index 4acd6db6f3..c17fd5fb1d 100644 --- a/apps/web/components/booking/pages/BookingPage.tsx +++ b/apps/web/components/booking/pages/BookingPage.tsx @@ -665,7 +665,7 @@ const BookingPage = ({ defaultChecked={i === 0} /> - {locationKeyToString(location)} + {t(locationKeyToString(location) ?? "")} ); @@ -689,7 +689,7 @@ const BookingPage = ({ {selectedLocationType === LocationType.Phone ? t("phone_number") : selectedLocationType === LocationType.AttendeeInPerson - ? t("Address") + ? t("address") : ""}
diff --git a/apps/web/components/eventtype/EventSetupTab.tsx b/apps/web/components/eventtype/EventSetupTab.tsx index 6837634c92..82972e0e44 100644 --- a/apps/web/components/eventtype/EventSetupTab.tsx +++ b/apps/web/components/eventtype/EventSetupTab.tsx @@ -169,7 +169,7 @@ export const EventSetupTab = ( alt={`${eventLocationType.label} logo`} /> - {location[eventLocationType.defaultValueVariable] || eventLocationType.label} + {t(location[eventLocationType.defaultValueVariable] || eventLocationType.label)}
@@ -342,7 +342,7 @@ export const EventSetupTab = ( saveLocation={saveLocation} defaultValues={formMethods.getValues("locations")} selection={ - selectedLocation ? { value: selectedLocation.value, label: selectedLocation.label } : undefined + selectedLocation ? { value: selectedLocation.value, label: t(selectedLocation.label) } : undefined } setSelectedLocation={setSelectedLocation} setEditingLocationType={setEditingLocationType} diff --git a/apps/web/public/static/locales/de/common.json b/apps/web/public/static/locales/de/common.json index a31276860f..03534ba307 100644 --- a/apps/web/public/static/locales/de/common.json +++ b/apps/web/public/static/locales/de/common.json @@ -454,14 +454,17 @@ "additional_guests": "+ Weitere Gäste", "your_name": "Ihr Name", "email_address": "E-Mail Adresse", - "enter_valid_email": "Bitte geben Sie eine gültige Emaildresse ein", + "enter_valid_email": "Bitte geben Sie eine gültige E-Mail-Adresse ein", "location": "Ort", + "address": "Adresse", + "enter_address": "Geben Sie eine Adresse ein", + "in_person_attendee_address": "In Person (Adresse von Ihnen)", "yes": "Ja", "no": "Nein", "additional_notes": "Zusätzliche Notizen", "booking_fail": "Termin konnte nicht gebucht werden.", "reschedule_fail": "Termin konnte nicht neugeplant werden.", - "share_additional_notes": "Bitten teilen Sie Notizen zur Vorbereitung des Termins, falls nötig.", + "share_additional_notes": "Teilen Sie uns weitere Informationen mit, die zur Vorbereitung des Termins hilfreich sind.", "booking_confirmation": "Bestätigen Sie {{eventTypeTitle}} mit {{profileName}}", "booking_reschedule_confirmation": "Planen Sie Ihr {{eventTypeTitle}} mit {{profileName}} um", "in_person_meeting": "Vor-Ort-Termin", diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index d1e505129e..56daf35c76 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -460,6 +460,9 @@ "email_address": "Email address", "enter_valid_email": "Please enter a valid email", "location": "Location", + "address": "Address", + "enter_address": "Enter address", + "in_person_attendee_address": "In Person (Attendee Address)", "yes": "yes", "no": "no", "additional_notes": "Additional notes", diff --git a/packages/app-store/locations.ts b/packages/app-store/locations.ts index 040684ffc5..5789eb830e 100644 --- a/packages/app-store/locations.ts +++ b/packages/app-store/locations.ts @@ -64,12 +64,12 @@ export const defaultLocations: DefaultEventLocationType[] = [ { default: true, type: DefaultEventLocationTypeEnum.AttendeeInPerson, - label: "In Person (Attendee Address)", + label: "in_person_attendee_address", variable: "address", organizerInputType: null, messageForOrganizer: "Cal will ask your invitee to enter an address before scheduling.", attendeeInputType: "attendeeAddress", - attendeeInputPlaceholder: `Enter Address`, + attendeeInputPlaceholder: "enter_address", defaultValueVariable: "attendeeAddress", iconUrl: "/map-pin.svg", category: "in person",