Scheduling infrastructure for absolutely everyone.
fix localization issues with default locations (#5569)
Marlo Kesser42766b42c0ac
diff --git a/apps/web/components/booking/AvailableEventLocations.tsx b/apps/web/components/booking/AvailableEventLocations.tsxindex b7f8e4f8f75..9c05ee7dc52 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 ? (<div className="dark:text-darkgray-600 mr-6 flex w-full flex-col space-y-2 break-words text-sm text-gray-600">{locations.map((location) => {@@ -27,8 +30,8 @@ export function AvailableEventLocations({ locations }: { locations: Props["eventalt={`${eventLocationType.label} icon`}/>)}- <Tooltip content={locationKeyToString(location)}>- <p className="truncate">{locationKeyToString(location)}</p>+ <Tooltip content={t(locationKeyToString(location) ?? "")}>+ <p className="truncate">{t(locationKeyToString(location) ?? "")}</p></Tooltip></div>);diff --git a/apps/web/components/booking/pages/BookingPage.tsx b/apps/web/components/booking/pages/BookingPage.tsxindex 4acd6db6f34..c17fd5fb1df 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}/><span className="text-sm ltr:ml-2 ltr:mr-2 rtl:ml-2 dark:text-white">- {locationKeyToString(location)}+ {t(locationKeyToString(location) ?? "")}</span></label>);@@ -689,7 +689,7 @@ const BookingPage = ({{selectedLocationType === LocationType.Phone? t("phone_number"): selectedLocationType === LocationType.AttendeeInPerson- ? t("Address")+ ? t("address"): ""}</label><div className="mt-1">diff --git a/apps/web/components/eventtype/EventSetupTab.tsx b/apps/web/components/eventtype/EventSetupTab.tsxindex 6837634c929..82972e0e440 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`}/><span className="truncate text-sm ltr:ml-1 rtl:mr-1">- {location[eventLocationType.defaultValueVariable] || eventLocationType.label}+ {t(location[eventLocationType.defaultValueVariable] || eventLocationType.label)}</span></div><div className="flex">@@ -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.jsonindex a31276860fb..03534ba3072 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.jsonindex d1e505129eb..56daf35c762 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.tsindex 040684ffc5c..5789eb830e2 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",