fix: translate boolean values in emails (#12741)

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
This commit is contained in:
Amit Sharma 2023-12-19 22:03:06 +05:30 committed by GitHub
parent 544d76d503
commit 48eba5ef5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 49 additions and 40 deletions

View File

@ -575,7 +575,7 @@ export default function Success(props: SuccessProps) {
className="text-default break-words"
data-testid="field-response"
data-fob-field={field.name}>
{response.toString()}
{field.type === "boolean" ? (response ? t("yes") : t("no")) : response.toString()}
</p>
</>
);

View File

@ -537,8 +537,8 @@
"address": "Adresa",
"enter_address": "Zadejte adresu",
"in_person_attendee_address": "Osobně (adresa účastníka)",
"yes": "ano",
"no": "ne",
"yes": "Ano",
"no": "Ne",
"additional_notes": "Doplňující poznámky",
"booking_fail": "Schůzku nelze rezervovat.",
"reschedule_fail": "Schůzku nelze přesunout na jindy.",

View File

@ -446,8 +446,8 @@
"address": "Adresse",
"enter_address": "Indtast adresse",
"in_person_attendee_address": "Personlig (Deltageradresse)",
"yes": "ja",
"no": "nej",
"yes": "Ja",
"no": "Nej",
"additional_notes": "Yderligere bemærkninger",
"booking_fail": "Kunne ikke booke mødet.",
"reschedule_fail": "Kunne ikke omlægge mødet.",

View File

@ -212,8 +212,8 @@
"location": "Τοποθεσία",
"address": "Διεύθυνση",
"enter_address": "Εισάγετε διεύθυνση",
"yes": "ναι",
"no": "όχι",
"yes": "Ναί",
"no": "Όχι",
"additional_notes": "Πρόσθετες σημειώσεις",
"phone_number": "Αριθμός Τηλεφώνου",
"attendee_phone_number": "Αριθμός Τηλεφώνου Συμμετέχοντα",

View File

@ -553,8 +553,8 @@
"address": "Address",
"enter_address": "Enter address",
"in_person_attendee_address": "In Person (Attendee Address)",
"yes": "yes",
"no": "no",
"yes": "Yes",
"no": "No",
"additional_notes": "Additional notes",
"booking_fail": "Could not book the meeting.",
"reschedule_fail": "Could not reschedule the meeting.",

View File

@ -367,8 +367,8 @@
"address": "Helbidea",
"enter_address": "Sartu helbidea",
"in_person_attendee_address": "Aurrez aurre (partaidearen helbidean)",
"yes": "bai",
"no": "ez",
"yes": "Bai",
"no": "Ez",
"additional_notes": "Ohar gehigarriak",
"booking_fail": "Ezin izan da bilera erreserbatu.",
"reschedule_fail": "Ezin izan da bilera berrantolatu.",

View File

@ -541,8 +541,8 @@
"address": "Adresse",
"enter_address": "Entrer une adresse",
"in_person_attendee_address": "En personne (adresse du participant)",
"yes": "oui",
"no": "non",
"yes": "Oui",
"no": "Non",
"additional_notes": "Notes supplémentaires",
"booking_fail": "Le rendez-vous n'a pas pu être réservé.",
"reschedule_fail": "Le rendez-vous n'a pas pu être replanifié.",

View File

@ -123,8 +123,8 @@
"your_name": "Neved",
"email_address": "Email cím",
"location": "Helyszín",
"yes": "igen",
"no": "nem",
"yes": "Igen",
"no": "Nem",
"additional_notes": "Egyéb jegyzetek",
"phone_number": "Telefonszám",
"or": "VAGY",

View File

@ -537,8 +537,8 @@
"address": "Indirizzo",
"enter_address": "Immettere l'indirizzo",
"in_person_attendee_address": "Di persona (indirizzo del partecipante)",
"yes": "sì",
"no": "no",
"yes": "Sì",
"no": "No",
"additional_notes": "Note aggiuntive",
"booking_fail": "Impossibile prenotare la riunione.",
"reschedule_fail": "Impossibile riprogrammare la riunione.",

View File

@ -537,8 +537,8 @@
"address": "Adres",
"enter_address": "Voer adres in",
"in_person_attendee_address": "Persoonlijk (adres deelnemer)",
"yes": "ja",
"no": "nee",
"yes": "Ja",
"no": "Nee",
"additional_notes": "Aanvullende notities",
"booking_fail": "De afspraak kon niet geboekt worden.",
"reschedule_fail": "De afspraak kon niet opnieuw gepland worden.",

View File

@ -440,8 +440,8 @@
"address": "Adresse",
"enter_address": "Skriv inn adresse",
"in_person_attendee_address": "Personlig Oppmøte (Deltakers Adresse)",
"yes": "ja",
"no": "nei",
"yes": "Ja",
"no": "Nei",
"additional_notes": "Tilleggsinformasjon",
"booking_fail": "Kunne ikke booke møtet.",
"reschedule_fail": "Kunne ikke endre tidspunkt for møtet.",

View File

@ -537,8 +537,8 @@
"address": "Adres",
"enter_address": "Wprowadź adres",
"in_person_attendee_address": "Osobiście (adres uczestnika)",
"yes": "tak",
"no": "nie",
"yes": "Tak",
"no": "Nie",
"additional_notes": "Dotatkowe uwagi",
"booking_fail": "Nie można zarezerwować spotkania.",
"reschedule_fail": "Nie udało się przełożyć spotkania.",

View File

@ -537,8 +537,8 @@
"address": "Local",
"enter_address": "Insira o endereço",
"in_person_attendee_address": "Pessoalmente (endereço do participante)",
"yes": "sim",
"no": "não",
"yes": "Sim",
"no": "Não",
"additional_notes": "Observações adicionais",
"booking_fail": "Não foi possível agendar a reunião.",
"reschedule_fail": "Não foi possível reagendar a reunião.",

View File

@ -537,8 +537,8 @@
"address": "Adresă",
"enter_address": "Introdu adresa",
"in_person_attendee_address": "În persoană (adresă participant)",
"yes": "da",
"no": "nu",
"yes": "Da",
"no": "Nu",
"additional_notes": "Date suplimentare",
"booking_fail": "Nu s-a putut rezerva întâlnirea.",
"reschedule_fail": "Nu s-a putut reprograma întâlnirea.",

View File

@ -537,8 +537,8 @@
"address": "Lokacija",
"enter_address": "Unesite adresu",
"in_person_attendee_address": "Lično (adresa polaznika)",
"yes": "da",
"no": "ne",
"yes": "Da",
"no": "Ne",
"additional_notes": "Dodatne beleške",
"booking_fail": "Sastanak nije mogao da se rezerviše.",
"reschedule_fail": "Sastanak nije mogao da se odloži.",

View File

@ -537,8 +537,8 @@
"address": "Adress",
"enter_address": "Ange adress",
"in_person_attendee_address": "Personligen (deltagandeadress)",
"yes": "ja",
"no": "nej",
"yes": "Ja",
"no": "Nej",
"additional_notes": "Ytterligare noteringar",
"booking_fail": "Det gick inte att boka mötet.",
"reschedule_fail": "Kunde inte omboka mötet.",

View File

@ -537,8 +537,8 @@
"address": "Adres",
"enter_address": "Adres girin",
"in_person_attendee_address": "Şahsen (Katılımcı Adresi)",
"yes": "evet",
"no": "hayır",
"yes": "Evet",
"no": "Hayır",
"additional_notes": "Ek notlar",
"booking_fail": "Toplantı rezervasyonu yapılamadı.",
"reschedule_fail": "Toplantı yeniden planlanamadı.",

View File

@ -537,8 +537,8 @@
"address": "Адреса",
"enter_address": "Введіть адресу",
"in_person_attendee_address": "Особисто (адреса відвідувача)",
"yes": "так",
"no": "ні",
"yes": "Так",
"no": "Hі",
"additional_notes": "Додаткові примітки",
"booking_fail": "Не вдалося забронювати нараду.",
"reschedule_fail": "Не вдалося перенести нараду.",

View File

@ -537,8 +537,8 @@
"address": "Địa chỉ",
"enter_address": "Nhập địa chỉ",
"in_person_attendee_address": "Đích thân (địa chỉ người tham gia)",
"yes": "",
"no": "không",
"yes": "Đúng",
"no": "Không",
"additional_notes": "Ghi chú bổ sung",
"booking_fail": "Không thể đặt cuộc họp.",
"reschedule_fail": "Không thể lên lịch lại cuộc họp.",

View File

@ -1,9 +1,12 @@
import type { TFunction } from "next-i18next";
import getLabelValueMapFromResponses from "@calcom/lib/getLabelValueMapFromResponses";
import type { CalendarEvent } from "@calcom/types/Calendar";
import { Info } from "./Info";
export function UserFieldsResponses(props: { calEvent: CalendarEvent }) {
export function UserFieldsResponses(props: { calEvent: CalendarEvent; t: TFunction }) {
const { t } = props;
const labelValueMap = getLabelValueMapFromResponses(props.calEvent);
if (!labelValueMap) return null;
@ -14,7 +17,13 @@ export function UserFieldsResponses(props: { calEvent: CalendarEvent }) {
<Info
key={key}
label={key}
description={`${labelValueMap[key] ? labelValueMap[key] : ""}`}
description={
typeof labelValueMap[key] === "boolean"
? labelValueMap[key]
? t("yes")
: t("no")
: `${labelValueMap[key] ? labelValueMap[key] : ""}`
}
withSpacer
/>
) : null

View File

@ -85,7 +85,7 @@ export const BaseScheduledEmail = (
<Info label={t("description")} description={props.calEvent.description} withSpacer formatted />
<Info label={t("additional_notes")} description={props.calEvent.additionalNotes} withSpacer />
{props.includeAppsStatus && <AppsStatus calEvent={props.calEvent} t={t} />}
<UserFieldsResponses calEvent={props.calEvent} />
<UserFieldsResponses t={t} calEvent={props.calEvent} />
{props.calEvent.paymentInfo?.amount && (
<Info
label={props.calEvent.paymentInfo.paymentOption === "HOLD" ? t("no_show_fee") : t("price")}