Email language fixes

This commit is contained in:
zomars
2022-06-07 08:49:39 -06:00
parent 0f5550680a
commit e863b71dfa
5 changed files with 13 additions and 9 deletions
@@ -1,11 +1,13 @@
import type { TFunction } from "next-i18next";
import { getAppName } from "@calcom/app-store/utils";
import type { CalendarEvent } from "@calcom/types/Calendar";
import { Info } from "./Info";
import { LinkIcon } from "./LinkIcon";
export function LocationInfo(props: { calEvent: CalendarEvent }) {
const t = props.calEvent.attendees[0].language.translate;
export function LocationInfo(props: { calEvent: CalendarEvent; t: TFunction }) {
const { t } = props;
let providerName = props.calEvent.location && getAppName(props.calEvent.location);
if (props.calEvent.location && props.calEvent.location.includes("integrations:")) {
+4 -2
View File
@@ -1,3 +1,5 @@
import { TFunction } from "next-i18next";
import type { CalendarEvent } from "@calcom/types/Calendar";
import { Info } from "./Info";
@@ -13,8 +15,8 @@ const PersonInfo = ({ name = "", email = "", role = "" }) => (
</div>
);
export function WhoInfo(props: { calEvent: CalendarEvent }) {
const t = props.calEvent.attendees[0].language.translate;
export function WhoInfo(props: { calEvent: CalendarEvent; t: TFunction }) {
const { t } = props;
return (
<Info
label={t("who")}
@@ -3,7 +3,7 @@ import localizedFormat from "dayjs/plugin/localizedFormat";
import timezone from "dayjs/plugin/timezone";
import toArray from "dayjs/plugin/toArray";
import utc from "dayjs/plugin/utc";
import { TFunction } from "next-i18next";
import type { TFunction } from "next-i18next";
import type { CalendarEvent, Person, RecurringEvent } from "@calcom/types/Calendar";
@@ -70,8 +70,8 @@ export const BaseScheduledEmail = (
<Info label={t("rejection_reason")} description={props.calEvent.rejectionReason} withSpacer />
<Info label={t("what")} description={props.calEvent.type} withSpacer />
<WhenInfo calEvent={props.calEvent} recurringEvent={props.recurringEvent} t={t} timeZone={timeZone} />
<WhoInfo calEvent={props.calEvent} />
<LocationInfo calEvent={props.calEvent} />
<WhoInfo calEvent={props.calEvent} t={t} />
<LocationInfo calEvent={props.calEvent} t={t} />
<Info label={t("description")} description={props.calEvent.description} withSpacer />
<Info label={t("additional_notes")} description={props.calEvent.additionalNotes} withSpacer />
<CustomInputs calEvent={props.calEvent} />
@@ -1,4 +1,4 @@
import { TFunction } from "next-i18next";
import type { TFunction } from "next-i18next";
import { BaseEmailHtml, CallToAction } from "../components";
@@ -1,4 +1,4 @@
import { TFunction } from "next-i18next";
import type { TFunction } from "next-i18next";
import { BaseEmailHtml, CallToAction } from "../components";