fix: event location not translated in booking page (#7528)
* fix: event location not translated * fix: translate * chore: lowercase trans keys * fix: label * feat: snake case labels * fix: show the link if the user has one * fix: add translatable keys * fix: * chore: fix type error --------- Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Efraín Rochín <[email protected]> Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
30 files changed
+92
-86
No files matched your search
@@ -12,7 +12,7 @@ export type DefaultEventLocationType = {
|
||||
type: DefaultEventLocationTypeEnum;
|
||||
label: string;
|
||||
messageForOrganizer: string;
|
||||
category: string;
|
||||
category: "in person" | "other" | "phone";
|
||||
|
||||
iconUrl: string;
|
||||
urlRegExp?: string;
|
||||
@@ -66,7 +66,7 @@ export const defaultLocations: DefaultEventLocationType[] = [
|
||||
{
|
||||
default: true,
|
||||
type: DefaultEventLocationTypeEnum.AttendeeInPerson,
|
||||
label: "attendeeInPerson",
|
||||
label: "attendee_in_person",
|
||||
variable: "address",
|
||||
organizerInputType: null,
|
||||
messageForOrganizer: "Cal will ask your invitee to enter an address before scheduling.",
|
||||
@@ -79,7 +79,7 @@ export const defaultLocations: DefaultEventLocationType[] = [
|
||||
{
|
||||
default: true,
|
||||
type: DefaultEventLocationTypeEnum.InPerson,
|
||||
label: "inPerson",
|
||||
label: "in_person",
|
||||
organizerInputType: "text",
|
||||
messageForOrganizer: "Provide an Address or Place",
|
||||
// HACK:
|
||||
@@ -91,7 +91,7 @@ export const defaultLocations: DefaultEventLocationType[] = [
|
||||
{
|
||||
default: true,
|
||||
type: DefaultEventLocationTypeEnum.Link,
|
||||
label: "Link",
|
||||
label: "link_meeting",
|
||||
organizerInputType: "text",
|
||||
variable: "locationLink",
|
||||
messageForOrganizer: "Provide a Meeting Link",
|
||||
@@ -102,7 +102,7 @@ export const defaultLocations: DefaultEventLocationType[] = [
|
||||
{
|
||||
default: true,
|
||||
type: DefaultEventLocationTypeEnum.Phone,
|
||||
label: "Attendee Phone Number",
|
||||
label: "attendee_phone_number",
|
||||
variable: "phone",
|
||||
organizerInputType: null,
|
||||
attendeeInputType: "phone",
|
||||
@@ -117,7 +117,7 @@ export const defaultLocations: DefaultEventLocationType[] = [
|
||||
{
|
||||
default: true,
|
||||
type: DefaultEventLocationTypeEnum.UserPhone,
|
||||
label: "Organizer Phone Number",
|
||||
label: "organizer_phone_number",
|
||||
messageForOrganizer: "Provide your phone number",
|
||||
organizerInputType: "phone",
|
||||
variable: "locationPhoneNumber",
|
||||
|
||||
@@ -94,23 +94,17 @@ export function getLocationGroupedOptions(integrations: ReturnType<typeof getApp
|
||||
|
||||
// Translating labels and pushing into array
|
||||
for (const category in apps) {
|
||||
const tmp = { label: category, options: apps[category] };
|
||||
if (tmp.label === "in person") {
|
||||
tmp.options = tmp.options.map((l) => ({
|
||||
const tmp = {
|
||||
label: t(category),
|
||||
options: apps[category].map((l) => ({
|
||||
...l,
|
||||
label: t(l.label),
|
||||
}));
|
||||
} else {
|
||||
tmp.options.map((l) => ({
|
||||
...l,
|
||||
label: t(l.label.toLowerCase().split(" ").join("_")),
|
||||
}));
|
||||
}
|
||||
|
||||
tmp.label = t(tmp.label);
|
||||
})),
|
||||
};
|
||||
|
||||
locations.push(tmp);
|
||||
}
|
||||
|
||||
return locations;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user