Email for professionals and teams
Translate calendar sidebar and bookings
Hieu Nguyen (Jack)132ed85ebfd9
diff --git a/src/app/(calendar)/booking/booking-editor.tsx b/src/app/(calendar)/booking/booking-editor.tsxindex ae44359..82049fb 100644--- a/src/app/(calendar)/booking/booking-editor.tsx+++ b/src/app/(calendar)/booking/booking-editor.tsx@@ -3,6 +3,9 @@import { useEffect, useState } from "react";import { CalendarDays, ChevronDown, Clock3, MapPin, MoreHorizontal, Plus, Trash2, UserRound } from "lucide-react";import clsx from "clsx";+import { useLanguage } from "@/components/language-provider";+import { folderColorKeys } from "@/lib/folders/color-keys";+import type { TranslationKey } from "@/lib/i18n/types";import { Button } from "@/components/ui/button";import { Input } from "@/components/ui/input";import { Textarea } from "@/components/ui/textarea";@@ -14,6 +17,7 @@ import { bookingFormWithName, durationLabel, formAvailabilityLabel, matchBookingimport { BookingHostAvatar } from "./booking-host-avatar";export function BookingEditor({ form, open, editingId, username, hosts, canManageHosts, currentUserId, saving, onChange, onClose, onSave, onDelete, onToggleEnabled, onClosed }: BookingEditorProps) {+ const { t } = useLanguage();const [activeSection, setActiveSection] = useState<BookingEditorSection>(null);const [nameEditing, setNameEditing] = useState(false);const [moreOpen, setMoreOpen] = useState(false);@@ -25,35 +29,35 @@ export function BookingEditor({ form, open, editingId, username, hosts, canManagconst fieldClass = "h-10 w-full rounded-xl border border-neutral-200 bg-white px-3 text-sm";const toggle = (section: BookingEditorSection) => setActiveSection((current) => current === section ? null : section);- return <aside aria-label="Event details" aria-hidden={!open} inert={!open} onTransitionEnd={(event) => { if (event.target === event.currentTarget && event.propertyName === "width" && !open) onClosed(); }} className={clsx("relative z-10 h-full shrink-0 overflow-hidden transition-[width] duration-300 ease-in-out motion-reduce:transition-none", open ? "w-full sm:w-[392px]" : "w-0")}>+ return <aside aria-label={t("booking.editor.details")} aria-hidden={!open} inert={!open} onTransitionEnd={(event) => { if (event.target === event.currentTarget && event.propertyName === "width" && !open) onClosed(); }} className={clsx("relative z-10 h-full shrink-0 overflow-hidden transition-[width] duration-300 ease-in-out motion-reduce:transition-none", open ? "w-full sm:w-[392px]" : "w-0")}><div className={clsx("flex h-full w-[min(392px,100vw)] flex-col overflow-hidden rounded-t-2xl bg-white shadow-2xl shadow-neutral-100 transition-transform duration-300 ease-in-out motion-reduce:transition-none", open ? "translate-x-0" : "translate-x-full")}><div className="min-h-0 flex-1 overflow-y-auto overscroll-contain scrollbar-gutter-stable"><section className={sectionClass}><div className="flex items-center gap-3">- <button type="button" onClick={() => setActiveSection("event")} aria-label="Edit event color" className="h-6 w-6 shrink-0 rounded-full" style={{ backgroundColor: form.color }} />- {nameEditing ? <Input autoFocus aria-label="Meeting name" value={form.name} onChange={(event) => onChange(bookingFormWithName(form, event.target.value))} onBlur={() => setNameEditing(false)} onKeyDown={(event) => { if (event.key === "Enter" || event.key === "Escape") setNameEditing(false); }} placeholder="New meeting" maxLength={120} className="min-w-0 flex-1 cursor-text bg-neutral-100 text-xl font-semibold" /> : <button type="button" onClick={() => { setActiveSection("event"); setNameEditing(true); }} className={clsx("min-w-0 flex-1 break-words text-left text-xl font-semibold text-neutral-900", activeSection === "event" ? "cursor-text rounded-lg bg-neutral-100 px-2 py-1" : "hover:text-blue-700")}>{form.name || "New meeting"}</button>}- <button type="button" onClick={() => toggle("event")} aria-label="Toggle event details" aria-expanded={activeSection === "event"} className="rounded-full p-1 text-neutral-500 hover:bg-neutral-100"><ChevronDown className={clsx("h-5 w-5 transition-transform", activeSection === "event" && "rotate-180")} /></button>+ <button type="button" onClick={() => setActiveSection("event")} aria-label={t("booking.editor.editColor")} className="h-6 w-6 shrink-0 rounded-full" style={{ backgroundColor: form.color }} />+ {nameEditing ? <Input autoFocus aria-label={t("booking.editor.meetingName")} value={form.name} onChange={(event) => onChange(bookingFormWithName(form, event.target.value))} onBlur={() => setNameEditing(false)} onKeyDown={(event) => { if (event.key === "Enter" || event.key === "Escape") setNameEditing(false); }} placeholder={t("booking.editor.newMeeting")} maxLength={120} className="min-w-0 flex-1 cursor-text bg-neutral-100 text-xl font-semibold" /> : <button type="button" onClick={() => { setActiveSection("event"); setNameEditing(true); }} className={clsx("min-w-0 flex-1 break-words text-left text-xl font-semibold text-neutral-900", activeSection === "event" ? "cursor-text rounded-lg bg-neutral-100 px-2 py-1" : "hover:text-blue-700")}>{form.name || t("booking.editor.newMeeting")}</button>}+ <button type="button" onClick={() => toggle("event")} aria-label={t("booking.editor.toggleDetails")} aria-expanded={activeSection === "event"} className="rounded-full p-1 text-neutral-500 hover:bg-neutral-100"><ChevronDown className={clsx("h-5 w-5 transition-transform", activeSection === "event" && "rotate-180")} /></button></div>- {activeSection === "event" && <div className="mt-5 space-y-4"><label className="block text-sm font-medium text-neutral-700">Link slug<Input value={form.slug} onChange={(event) => onChange({ ...form, slug: slugifyBookingName(event.target.value) })} placeholder="new-meeting" maxLength={80} className="mt-2" /><span className="mt-1 block break-all text-xs font-normal text-neutral-500">/c/{username || "your-name"}/{form.slug || "event-slug"}</span></label><label className="block text-sm font-medium text-neutral-700">Description<Textarea value={form.description} onChange={(event) => onChange({ ...form, description: event.target.value })} placeholder="Tell guests what this meeting is about" maxLength={2000} rows={4} className="mt-2 resize-y" /></label><fieldset><legend className="text-sm font-medium text-neutral-700">Color</legend><div className="mt-2 flex flex-wrap gap-2" role="radiogroup" aria-label="Event color">{FOLDER_COLOR_OPTIONS.map((option) => <button key={option.value} type="button" role="radio" aria-label={option.label} aria-checked={form.color === option.value} onClick={() => onChange({ ...form, color: option.value })} className={clsx("flex h-8 w-8 items-center justify-center rounded-full border-2 border-white ring-2", form.color === option.value ? "ring-neutral-800" : "ring-transparent hover:ring-neutral-300")} style={{ backgroundColor: option.value }}>{form.color === option.value && <span className="h-2 w-2 rounded-full bg-white" />}</button>)}</div></fieldset></div>}+ {activeSection === "event" && <div className="mt-5 space-y-4"><label className="block text-sm font-medium text-neutral-700">{t("booking.editor.slug")}<Input value={form.slug} onChange={(event) => onChange({ ...form, slug: slugifyBookingName(event.target.value) })} placeholder={t("booking.editor.slugPlaceholder")} maxLength={80} className="mt-2" /><span className="mt-1 block break-all text-xs font-normal text-neutral-500">/c/{username || t("booking.editor.yourName")}/{form.slug || t("booking.editor.eventSlug")}</span></label><label className="block text-sm font-medium text-neutral-700">{t("calendar.description")}<Textarea value={form.description} onChange={(event) => onChange({ ...form, description: event.target.value })} placeholder={t("booking.editor.descriptionPlaceholder")} maxLength={2000} rows={4} className="mt-2 resize-y" /></label><fieldset><legend className="text-sm font-medium text-neutral-700">{t("booking.editor.color")}</legend><div className="mt-2 flex flex-wrap gap-2" role="radiogroup" aria-label={t("calendar.eventColor")}>{FOLDER_COLOR_OPTIONS.map((option) => <button key={option.value} type="button" role="radio" aria-label={t(folderColorKeys[option.value])} aria-checked={form.color === option.value} onClick={() => onChange({ ...form, color: option.value })} className={clsx("flex h-8 w-8 items-center justify-center rounded-full border-2 border-white ring-2", form.color === option.value ? "ring-neutral-800" : "ring-transparent hover:ring-neutral-300")} style={{ backgroundColor: option.value }}>{form.color === option.value && <span className="h-2 w-2 rounded-full bg-white" />}</button>)}</div></fieldset></div>}</section>- <section className={sectionClass}><button type="button" onClick={() => toggle("duration")} aria-expanded={activeSection === "duration"} className={headingClass}><span>Duration</span><ChevronDown className={clsx("h-5 w-5 text-neutral-500 transition-transform", activeSection === "duration" && "rotate-180")} /></button>{activeSection === "duration" ? <div className="mt-4"><select aria-label="Meeting length" value={[15, 30, 45, 60].includes(form.durationMinutes) ? form.durationMinutes : "custom"} onChange={(event) => onChange({ ...form, durationMinutes: event.target.value === "custom" ? 90 : Number(event.target.value) })} className={fieldClass}><option value={15}>15 minutes</option><option value={30}>30 minutes</option><option value={45}>45 minutes</option><option value={60}>1 hour</option><option value="custom">Custom</option></select>{![15, 30, 45, 60].includes(form.durationMinutes) && <Input aria-label="Custom minutes" type="number" min={5} max={480} step={5} value={form.durationMinutes} onChange={(event) => onChange({ ...form, durationMinutes: Number(event.target.value) })} className="mt-3" />}</div> : <button type="button" onClick={() => toggle("duration")} className="mt-2 flex w-full items-center gap-2 text-left text-sm text-neutral-500"><Clock3 className="h-4 w-4" />{durationLabel(form.durationMinutes)}</button>}</section>- <section className={sectionClass}><button type="button" onClick={() => toggle("location")} aria-expanded={activeSection === "location"} className={headingClass}><span>Location</span><ChevronDown className={clsx("h-5 w-5 text-neutral-500 transition-transform", activeSection === "location" && "rotate-180")} /></button>{activeSection === "location" ? <Input aria-label="Location" value={form.location} onChange={(event) => onChange({ ...form, location: event.target.value })} placeholder="Phone call, video link, or address" maxLength={240} className="mt-4" /> : <button type="button" onClick={() => toggle("location")} className="mt-2 flex w-full items-center gap-2 text-left text-sm text-neutral-500"><MapPin className="h-4 w-4" />{form.location || "No location set"}</button>}</section>- <section className={sectionClass}><button type="button" onClick={() => toggle("availability")} aria-expanded={activeSection === "availability"} className={headingClass}><span>Availability</span><ChevronDown className={clsx("h-5 w-5 text-neutral-500 transition-transform", activeSection === "availability" && "rotate-180")} /></button>{activeSection === "availability" ? <div className="mt-4 space-y-4"><fieldset aria-label="Available days"><div className="flex flex-wrap gap-1">{WEEKDAYS.map((day) => <button key={day.value} type="button" aria-label={day.label} aria-pressed={form.weekdays.includes(day.value)} onClick={() => onChange({ ...form, weekdays: form.weekdays.includes(day.value) ? form.weekdays.filter((value) => value !== day.value) : [...form.weekdays, day.value].sort() })} className={clsx("rounded-full px-3 py-1.5 text-xs font-medium", form.weekdays.includes(day.value) ? "bg-blue-600 text-white" : "bg-neutral-100 text-neutral-600 hover:bg-neutral-200")}>{day.short}</button>)}</div></fieldset><div className="flex flex-row gap-8 mt-2"><p className="text-sm font-medium text-neutral-700 mt-3">Times</p>+ <section className={sectionClass}><button type="button" onClick={() => toggle("duration")} aria-expanded={activeSection === "duration"} className={headingClass}><span>{t("booking.editor.duration")}</span><ChevronDown className={clsx("h-5 w-5 text-neutral-500 transition-transform", activeSection === "duration" && "rotate-180")} /></button>{activeSection === "duration" ? <div className="mt-4"><select aria-label={t("booking.editor.meetingLength")} value={[15, 30, 45, 60].includes(form.durationMinutes) ? form.durationMinutes : "custom"} onChange={(event) => onChange({ ...form, durationMinutes: event.target.value === "custom" ? 90 : Number(event.target.value) })} className={fieldClass}><option value={15}>{t("booking.editor.minutes15")}</option><option value={30}>{t("booking.editor.minutes30")}</option><option value={45}>{t("booking.editor.minutes45")}</option><option value={60}>{t("booking.editor.hour1")}</option><option value="custom">{t("booking.editor.custom")}</option></select>{![15, 30, 45, 60].includes(form.durationMinutes) && <Input aria-label={t("booking.editor.customMinutes")} type="number" min={5} max={480} step={5} value={form.durationMinutes} onChange={(event) => onChange({ ...form, durationMinutes: Number(event.target.value) })} className="mt-3" />}</div> : <button type="button" onClick={() => toggle("duration")} className="mt-2 flex w-full items-center gap-2 text-left text-sm text-neutral-500"><Clock3 className="h-4 w-4" />{durationLabel(form.durationMinutes, t)}</button>}</section>+ <section className={sectionClass}><button type="button" onClick={() => toggle("location")} aria-expanded={activeSection === "location"} className={headingClass}><span>{t("booking.editor.location")}</span><ChevronDown className={clsx("h-5 w-5 text-neutral-500 transition-transform", activeSection === "location" && "rotate-180")} /></button>{activeSection === "location" ? <Input aria-label={t("booking.editor.location")} value={form.location} onChange={(event) => onChange({ ...form, location: event.target.value })} placeholder={t("booking.editor.locationPlaceholder")} maxLength={240} className="mt-4" /> : <button type="button" onClick={() => toggle("location")} className="mt-2 flex w-full items-center gap-2 text-left text-sm text-neutral-500"><MapPin className="h-4 w-4" />{form.location || t("booking.noLocation")}</button>}</section>+ <section className={sectionClass}><button type="button" onClick={() => toggle("availability")} aria-expanded={activeSection === "availability"} className={headingClass}><span>{t("booking.editor.availability")}</span><ChevronDown className={clsx("h-5 w-5 text-neutral-500 transition-transform", activeSection === "availability" && "rotate-180")} /></button>{activeSection === "availability" ? <div className="mt-4 space-y-4"><fieldset aria-label={t("booking.editor.availableDays")}><div className="flex flex-wrap gap-1">{WEEKDAYS.map((day) => <button key={day} type="button" aria-label={t(`weekday.${day}` as TranslationKey)} aria-pressed={form.weekdays.includes(day)} onClick={() => onChange({ ...form, weekdays: form.weekdays.includes(day) ? form.weekdays.filter((value) => value !== day) : [...form.weekdays, day].sort() })} className={clsx("rounded-full px-3 py-1.5 text-xs font-medium", form.weekdays.includes(day) ? "bg-blue-600 text-white" : "bg-neutral-100 text-neutral-600 hover:bg-neutral-200")}>{t(`calendar.weekdayShort.${day}` as TranslationKey)}</button>)}</div></fieldset><div className="flex flex-row gap-8 mt-2"><p className="text-sm font-medium text-neutral-700 mt-3">{t("booking.editor.times")}</p>- <div className="space-y-2 flex flex-col items-start flex-1 min-w-0 w-fll">{form.timeRanges.map((range, index) => <div key={index} className="flex items-end gap-2 w-full"><label className="min-w-0 flex-1 text-xs text-neutral-500">From<Input type="time" step={900} value={range.startTime} onChange={(event) => onChange({ ...form, timeRanges: form.timeRanges.map((item, itemIndex) => itemIndex === index ? { ...item, startTime: event.target.value } : item) })} className="mt-1 flex-1 min-w-0" /></label><label className="min-w-0 flex-1 text-xs text-neutral-500">To<Input type="time" step={900} value={range.endTime} onChange={(event) => onChange({ ...form, timeRanges: form.timeRanges.map((item, itemIndex) => itemIndex === index ? { ...item, endTime: event.target.value } : item) })} className="mt-1 flex-1 min-w-0" /></label><button type="button" aria-label={`Remove time ${index + 1}`} disabled={form.timeRanges.length === 1} onClick={() => onChange({ ...form, timeRanges: form.timeRanges.filter((_, itemIndex) => itemIndex !== index) })} className="mb-1 rounded-full p-2 text-neutral-500 hover:bg-neutral-100 disabled:opacity-30"><Trash2 className="h-4 w-4" /></button></div>)}+ <div className="space-y-2 flex flex-col items-start flex-1 min-w-0 w-fll">{form.timeRanges.map((range, index) => <div key={index} className="flex items-end gap-2 w-full"><label className="min-w-0 flex-1 text-xs text-neutral-500">{t("calendar.from")}<Input type="time" step={900} value={range.startTime} onChange={(event) => onChange({ ...form, timeRanges: form.timeRanges.map((item, itemIndex) => itemIndex === index ? { ...item, startTime: event.target.value } : item) })} className="mt-1 flex-1 min-w-0" /></label><label className="min-w-0 flex-1 text-xs text-neutral-500">{t("calendar.to")}<Input type="time" step={900} value={range.endTime} onChange={(event) => onChange({ ...form, timeRanges: form.timeRanges.map((item, itemIndex) => itemIndex === index ? { ...item, endTime: event.target.value } : item) })} className="mt-1 flex-1 min-w-0" /></label><button type="button" aria-label={t("booking.editor.removeTime", { n: index + 1 })} disabled={form.timeRanges.length === 1} onClick={() => onChange({ ...form, timeRanges: form.timeRanges.filter((_, itemIndex) => itemIndex !== index) })} className="mb-1 rounded-full p-2 text-neutral-500 hover:bg-neutral-100 disabled:opacity-30"><Trash2 className="h-4 w-4" /></button></div>)}- <button type="button" disabled={form.timeRanges.length >= 12} onClick={() => onChange({ ...form, timeRanges: [...form.timeRanges, nextBookingTimeRange(form.timeRanges, form.durationMinutes)] })} className="mt-3 inline-flex items-center gap-1 text-sm font-medium text-blue-700 hover:text-blue-600 disabled:opacity-50"><Plus className="h-4 w-4" />Add time</button>+ <button type="button" disabled={form.timeRanges.length >= 12} onClick={() => onChange({ ...form, timeRanges: [...form.timeRanges, nextBookingTimeRange(form.timeRanges, form.durationMinutes)] })} className="mt-3 inline-flex items-center gap-1 text-sm font-medium text-blue-700 hover:text-blue-600 disabled:opacity-50"><Plus className="h-4 w-4" />{t("booking.editor.addTime")}</button></div></div>- <p className="text-xs text-neutral-500">Times use {form.timeZone}.</p></div> : <button type="button" onClick={() => toggle("availability")} className="mt-2 flex w-full items-center gap-2 text-left text-sm text-neutral-500"><CalendarDays className="h-4 w-4 shrink-0" />{formAvailabilityLabel(form)}</button>}</section>+ <p className="text-xs text-neutral-500">{t("booking.editor.timesUse", { zone: form.timeZone })}</p></div> : <button type="button" onClick={() => toggle("availability")} className="mt-2 flex w-full items-center gap-2 text-left text-sm text-neutral-500"><CalendarDays className="h-4 w-4 shrink-0" />{formAvailabilityLabel(form, t)}</button>}</section><section className={sectionClass}>- <button type="button" onClick={() => toggle("host")} aria-expanded={activeSection === "host"} className={headingClass}><span>Host</span><ChevronDown className={clsx("h-5 w-5 text-neutral-500 transition-transform", activeSection === "host" && "rotate-180")} /></button>+ <button type="button" onClick={() => toggle("host")} aria-expanded={activeSection === "host"} className={headingClass}><span>{t("booking.editor.host")}</span><ChevronDown className={clsx("h-5 w-5 text-neutral-500 transition-transform", activeSection === "host" && "rotate-180")} /></button>{activeSection === "host" ? <div className="mt-4 space-y-4">- <div className="space-y-2">{form.hostIds.map((id) => { const host = hosts.find((item) => item.id === id); const isCurrentUser = id === currentUserId; return <div key={id} className="flex items-center gap-3 rounded-xl bg-neutral-50 px-3 py-2">{host ? <BookingHostAvatar host={host} currentUserId={currentUserId} /> : <span className="flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-neutral-200 text-neutral-500"><UserRound className="h-4 w-4" /></span>}<span className="min-w-0 flex-1"><span className="block truncate text-sm font-medium text-neutral-900">{host?.name || "Unavailable user"}{isCurrentUser ? " (you)" : ""}</span><span className="block truncate text-xs text-neutral-500">{host?.email}</span></span>{!isCurrentUser && <button type="button" onClick={() => onChange({ ...form, hostIds: form.hostIds.filter((hostId) => hostId !== id) })} className="text-xs font-medium text-neutral-500 hover:text-red-600">Remove</button>}</div>; })}</div>- {canManageHosts && <form onSubmit={(event) => { event.preventDefault(); const match = matchBookingHost(hosts, hostQuery); if (!match.host) { setHostError(match.error); return; } if (form.hostIds.includes(match.host.id)) { setHostError("This user is already a host."); return; } if (form.hostIds.length >= 20) { setHostError("A booking can have up to 20 hosts."); return; } onChange({ ...form, hostIds: [...form.hostIds, match.host.id] }); setHostQuery(""); setHostError(""); }}><label htmlFor="booking-host-input" className="block text-sm font-medium text-neutral-700">Add a host</label><div className="mt-2 flex gap-2"><Input id="booking-host-input" value={hostQuery} onChange={(event) => { setHostQuery(event.target.value); setHostError(""); }} placeholder="Name or email" autoComplete="off" aria-invalid={!!hostError} aria-describedby={hostError ? "booking-host-error" : undefined} className="min-w-0 flex-1" /><Button type="submit" variant="outline" className="shrink-0 rounded-full">Add</Button></div>{hostError && <p id="booking-host-error" role="alert" className="mt-2 text-xs text-red-600">{hostError}</p>}</form>}- </div> : <button type="button" onClick={() => toggle("host")} className="mt-2 flex w-full items-center gap-2 text-left text-sm text-neutral-500"><span className="flex shrink-0 -space-x-1">{form.hostIds.slice(0, 3).map((id) => { const host = hosts.find((item) => item.id === id); return host ? <BookingHostAvatar key={id} host={host} currentUserId={currentUserId} size="small" /> : <span key={id} className="flex h-5 w-5 items-center justify-center rounded-full bg-neutral-200"><UserRound className="h-3 w-3" /></span>; })}</span><span className="truncate">{form.hostIds.map((id) => hosts.find((host) => host.id === id)?.name ?? "User").join(", ")}</span></button>}+ <div className="space-y-2">{form.hostIds.map((id) => { const host = hosts.find((item) => item.id === id); const isCurrentUser = id === currentUserId; return <div key={id} className="flex items-center gap-3 rounded-xl bg-neutral-50 px-3 py-2">{host ? <BookingHostAvatar host={host} currentUserId={currentUserId} /> : <span className="flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-neutral-200 text-neutral-500"><UserRound className="h-4 w-4" /></span>}<span className="min-w-0 flex-1"><span className="block truncate text-sm font-medium text-neutral-900">{host?.name || t("booking.editor.unavailableUser")}{isCurrentUser ? t("booking.editor.you") : ""}</span><span className="block truncate text-xs text-neutral-500">{host?.email}</span></span>{!isCurrentUser && <button type="button" onClick={() => onChange({ ...form, hostIds: form.hostIds.filter((hostId) => hostId !== id) })} className="text-xs font-medium text-neutral-500 hover:text-red-600">{t("resend.remove")}</button>}</div>; })}</div>+ {canManageHosts && <form onSubmit={(event) => { event.preventDefault(); const match = matchBookingHost(hosts, hostQuery, t); if (!match.host) { setHostError(match.error); return; } if (form.hostIds.includes(match.host.id)) { setHostError(t("booking.editor.alreadyHost")); return; } if (form.hostIds.length >= 20) { setHostError(t("booking.editor.maxHosts")); return; } onChange({ ...form, hostIds: [...form.hostIds, match.host.id] }); setHostQuery(""); setHostError(""); }}><label htmlFor="booking-host-input" className="block text-sm font-medium text-neutral-700">{t("booking.editor.addHost")}</label><div className="mt-2 flex gap-2"><Input id="booking-host-input" value={hostQuery} onChange={(event) => { setHostQuery(event.target.value); setHostError(""); }} placeholder={t("booking.editor.nameOrEmail")} autoComplete="off" aria-invalid={!!hostError} aria-describedby={hostError ? "booking-host-error" : undefined} className="min-w-0 flex-1" /><Button type="submit" variant="outline" className="shrink-0 rounded-full">{t("booking.editor.add")}</Button></div>{hostError && <p id="booking-host-error" role="alert" className="mt-2 text-xs text-red-600">{hostError}</p>}</form>}+ </div> : <button type="button" onClick={() => toggle("host")} className="mt-2 flex w-full items-center gap-2 text-left text-sm text-neutral-500"><span className="flex shrink-0 -space-x-1">{form.hostIds.slice(0, 3).map((id) => { const host = hosts.find((item) => item.id === id); return host ? <BookingHostAvatar key={id} host={host} currentUserId={currentUserId} size="small" /> : <span key={id} className="flex h-5 w-5 items-center justify-center rounded-full bg-neutral-200"><UserRound className="h-3 w-3" /></span>; })}</span><span className="truncate">{form.hostIds.map((id) => hosts.find((host) => host.id === id)?.name ?? t("booking.editor.userFallback")).join(", ")}</span></button>}</section></div>- <div className="relative flex shrink-0 items-center justify-end gap-2 bg-white px-4 py-3">{editingId && <div className="relative"><Button type="button" variant="outline" onClick={() => setMoreOpen((value) => !value)} className="h-9 rounded-full px-3"><MoreHorizontal className="h-4 w-4" />More</Button>{moreOpen && <div className="absolute bottom-full right-0 z-20 mb-2 w-40 rounded-xl border border-neutral-200 bg-white p-1 shadow-lg"><button type="button" onClick={() => { setMoreOpen(false); onToggleEnabled(); }} className="block w-full rounded-lg px-3 py-2 text-left text-sm hover:bg-neutral-100">Turn {form.enabled ? "off" : "on"}</button><button type="button" onClick={() => { setMoreOpen(false); onDelete(); }} className="block w-full rounded-lg px-3 py-2 text-left text-sm text-red-600 hover:bg-red-50">Delete</button></div>}</div>}<Button type="button" variant="ghost" disabled={saving} onClick={onClose} className="h-9 rounded-full px-4">Cancel</Button><Button type="button" disabled={saving} onClick={onSave} className="h-9 rounded-full px-4">{saving ? "Saving…" : editingId ? "Save changes" : "Create"}</Button></div>+ <div className="relative flex shrink-0 items-center justify-end gap-2 bg-white px-4 py-3">{editingId && <div className="relative"><Button type="button" variant="outline" onClick={() => setMoreOpen((value) => !value)} className="h-9 rounded-full px-3"><MoreHorizontal className="h-4 w-4" />{t("booking.editor.more")}</Button>{moreOpen && <div className="absolute bottom-full right-0 z-20 mb-2 w-40 rounded-xl border border-neutral-200 bg-white p-1 shadow-lg"><button type="button" onClick={() => { setMoreOpen(false); onToggleEnabled(); }} className="block w-full rounded-lg px-3 py-2 text-left text-sm hover:bg-neutral-100">{form.enabled ? t("booking.turnOff") : t("booking.turnOn")}</button><button type="button" onClick={() => { setMoreOpen(false); onDelete(); }} className="block w-full rounded-lg px-3 py-2 text-left text-sm text-red-600 hover:bg-red-50">{t("common.delete")}</button></div>}</div>}<Button type="button" variant="ghost" disabled={saving} onClick={onClose} className="h-9 rounded-full px-4">{t("common.cancel")}</Button><Button type="button" disabled={saving} onClick={onSave} className="h-9 rounded-full px-4">{saving ? t("common.saving") : editingId ? t("settings.mailbox.saveChanges") : t("booking.editor.create")}</Button></div></div></aside>;}diff --git a/src/app/(calendar)/booking/booking-host-avatar.tsx b/src/app/(calendar)/booking/booking-host-avatar.tsxindex d700861..766b4f0 100644--- a/src/app/(calendar)/booking/booking-host-avatar.tsx+++ b/src/app/(calendar)/booking/booking-host-avatar.tsx@@ -1,15 +1,17 @@"use client";import { useEffect, useState } from "react";+import { useLanguage } from "@/components/language-provider";import { ProgressiveAvatarImage } from "@/components/progressive-avatar-image";import { getAvatarColorStyle } from "@/lib/avatar-colors";import type { BookingHostAvatarProps } from "./types";export function BookingHostAvatar({ host, currentUserId, size = "medium" }: BookingHostAvatarProps) {+ const { t } = useLanguage();const [imageFailed, setImageFailed] = useState(false);const imageUrl = host.id === currentUserId ? "/api/profile/avatar" : `/api/accounts/${host.id}/avatar`;const sizeClass = size === "small" ? "h-5 w-5 text-[10px]" : "h-8 w-8 text-sm";useEffect(() => { setImageFailed(false); }, [host.id, host.hasAvatar]);- if (host.hasAvatar && !imageFailed) return <ProgressiveAvatarImage src={imageUrl} alt={`${host.name || host.email} profile picture`} className={`${sizeClass} shrink-0 rounded-full border border-neutral-200 object-cover`} onError={() => setImageFailed(true)} />;+ if (host.hasAvatar && !imageFailed) return <ProgressiveAvatarImage src={imageUrl} alt={t("account.profilePicture", { name: host.name || host.email })} className={`${sizeClass} shrink-0 rounded-full border border-neutral-200 object-cover`} onError={() => setImageFailed(true)} />;return <span aria-hidden="true" className={`${sizeClass} flex shrink-0 items-center justify-center rounded-full font-semibold`} style={getAvatarColorStyle(host.email)}>{(host.name || host.email).slice(0, 1).toUpperCase()}</span>;}diff --git a/src/app/(calendar)/booking/booking-list-skeleton.tsx b/src/app/(calendar)/booking/booking-list-skeleton.tsxindex ef70e70..10a0d83 100644--- a/src/app/(calendar)/booking/booking-list-skeleton.tsx+++ b/src/app/(calendar)/booking/booking-list-skeleton.tsx@@ -1,6 +1,11 @@+"use client";++import { useLanguage } from "@/components/language-provider";+export function BookingListSkeleton() {- return <div role="status" aria-label="Loading bookings" className="space-y-3">- <span className="sr-only">Loading bookings…</span>+ const { t } = useLanguage();+ return <div role="status" aria-label={t("booking.loading")} className="space-y-3">+ <span className="sr-only">{t("booking.loadingEllipsis")}</span>{[0, 1, 2].map((item) => <div key={item} className="rounded-2xl border border-neutral-200 bg-white px-5 py-5 motion-safe:animate-pulse"><div className="h-5 w-1/2 rounded bg-neutral-200" /><div className="mt-4 h-3 w-3/4 rounded bg-neutral-100" />diff --git a/src/app/(calendar)/booking/page.tsx b/src/app/(calendar)/booking/page.tsxindex c86833d..3b9ee8b 100644--- a/src/app/(calendar)/booking/page.tsx+++ b/src/app/(calendar)/booking/page.tsx@@ -6,6 +6,7 @@ import { mobilePrimaryActionClass } from "@/components/page-header-utils";import clsx from "clsx";import { CalendarDays, Check, Clock3, Copy, ExternalLink, MapPin, MoreHorizontal, Plus } from "lucide-react";import toast, { Toaster } from "react-hot-toast";+import { useLanguage } from "@/components/language-provider";import { Button } from "@/components/ui/button";import { RouteLoadingBarPortal } from "@/components/route-loading-bar-portal";import { authFetch } from "@/lib/auth/client";@@ -19,6 +20,7 @@ import type { BookingEvent, BookingForm, BookingHost } from "./types";import { availabilityLabel, durationLabel, emptyBookingForm, formFromEvent } from "./utils";export default function BookingsPage() {+ const { t } = useLanguage();const { minimal: sidebarMinimal, mobile } = useSidebar();const minimal = sidebarMinimal || mobile;const [events, setEvents] = useState<BookingEvent[]>([]);@@ -44,14 +46,14 @@ export default function BookingsPage() {if (active) { setEvents(data.events); setUsername(data.username ?? ""); setHosts([data.currentUser]); setCurrentUserId(data.currentUser.id); }if (!data.canManageHosts) return;const response = await authFetch("/api/accounts");- if (!response.ok) { if (active) toast.error("Could not load the user list."); return; }+ if (!response.ok) { if (active) toast.error(t("booking.hostListFailed")); return; }const accounts = await response.json() as { accounts: (BookingHost & { disabled: boolean })[] };if (active) { setHosts([data.currentUser, ...accounts.accounts.filter((account) => !account.disabled && account.id !== data.currentUser.id).map(({ id, name, email, hasAvatar }) => ({ id, name, email, hasAvatar }))]); setCanManageHosts(true); }})- .catch(() => { if (active) toast.error("Could not load bookings."); })+ .catch(() => { if (active) toast.error(t("booking.loadFailed")); }).finally(() => { if (active) setLoading(false); });return () => { active = false; };- }, []);+ }, [t]);useEffect(() => {if (panelOpen || !form) return;@@ -70,11 +72,11 @@ export default function BookingsPage() {try {const response = await authFetch(editingId ? `/api/booking/${editingId}` : "/api/booking", { method: editingId ? "PATCH" : "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(form) });const data = await response.json() as { event?: BookingEvent; error?: string };- if (!response.ok || !data.event) { toast.error(data.error ?? "Could not save booking event."); return; }+ if (!response.ok || !data.event) { toast.error(data.error ?? t("booking.saveFailed")); return; }setEvents((current) => editingId ? current.map((item) => item.id === editingId ? data.event! : item) : [...current, data.event!]);closeEditor();- toast.success(editingId ? "Booking event saved." : "Booking event created.");- } catch { toast.error("Could not save booking event."); }+ toast.success(editingId ? t("booking.saved") : t("booking.created"));+ } catch { toast.error(t("booking.saveFailed")); }finally { setSaving(false); }}@@ -88,25 +90,25 @@ export default function BookingsPage() {setEvents((current) => event.isTemplate ? [...current, data.event!] : current.map((item) => item.id === event.id ? data.event! : item));if (editingId === event.id && form) setForm({ ...form, enabled });setMenuId(null);- } catch { toast.error(event.isTemplate ? "Could not enable booking event." : "Could not update booking event."); }+ } catch { toast.error(event.isTemplate ? t("booking.enableFailed") : t("booking.updateFailed")); }finally { if (event.isTemplate) setSavingTemplateId(null); }}async function remove(event: BookingEvent) {- if (!window.confirm(`Delete “${event.name}”?`)) return;+ if (!window.confirm(t("booking.deleteConfirm", { name: event.name }))) return;try {const response = await authFetch(`/api/booking/${event.id}`, { method: "DELETE" });if (!response.ok) throw new Error();setEvents((current) => current.filter((item) => item.id !== event.id));if (editingId === event.id) closeEditor();setMenuId(null);- } catch { toast.error("Could not delete booking event."); }+ } catch { toast.error(t("booking.deleteFailed")); }}async function copyLink(event: BookingEvent) {- if (!username) { toast.error("Booking username is unavailable."); return; }- try { await navigator.clipboard.writeText(`${window.location.origin}/c/${username}/${event.slug}`); toast.success("Booking link copied."); }- catch { toast.error("Could not copy booking link."); }+ if (!username) { toast.error(t("booking.usernameUnavailable")); return; }+ try { await navigator.clipboard.writeText(`${window.location.origin}/c/${username}/${event.slug}`); toast.success(t("booking.linkCopied")); }+ catch { toast.error(t("booking.copyFailed")); }}return <div className={clsx("flex h-full min-h-0 flex-col bg-[#f6f8fc] pl-3 max-md:pl-0 transition-[gap] duration-200 ease-in-out motion-reduce:transition-none lg:flex-row", minimal ? "gap-0" : "gap-3")}>@@ -117,10 +119,10 @@ export default function BookingsPage() {<div className="flex h-full min-h-0 min-w-0"><div className="min-w-0 flex-1 overflow-y-auto overscroll-contain scrollbar-gutter-stable"><div className="mx-auto max-w-6xl px-5 md:px-8">- <section aria-label="Booking events" className="space-y-1 pt-3 max-md:pb-24">+ <section aria-label={t("booking.events")} className="space-y-1 pt-3 max-md:pb-24"><div className="flex flex-wrap items-start justify-between gap-4 pb-6 max-md:flex-nowrap max-md:gap-2">- <div className="min-w-0"><h1 className="text-xl font-semibold text-neutral-900 md:text-3xl">Bookings</h1><p className="mt-1 text-sm text-neutral-500">Set the meetings people can book with you.</p></div>+ <div className="min-w-0"><h1 className="text-xl font-semibold text-neutral-900 md:text-3xl">{t("booking.title")}</h1><p className="mt-1 text-sm text-neutral-500">{t("booking.description")}</p></div><div className="flex shrink-0 items-center gap-2"><Button variant="ghost" className="w-10 max-md:-mr-2">@@ -129,13 +131,13 @@ export default function BookingsPage() {</Link></Button>- <Button type="button" onClick={startCreate} disabled={!currentUserId} className={clsx("rounded-full", mobilePrimaryActionClass)}><Plus size={18} />New event</Button></div>+ <Button type="button" onClick={startCreate} disabled={!currentUserId} className={clsx("rounded-full", mobilePrimaryActionClass)}><Plus size={18} />{t("booking.newEvent")}</Button></div></div>- {loading ? <BookingListSkeleton /> : listEvents.length === 0 ? <div className="rounded-2xl border border-dashed border-neutral-300 bg-white px-6 py-12 text-center"><CalendarDays className="mx-auto mb-3 h-8 w-8 text-neutral-400" /><h2 className="font-medium text-neutral-900">No booking events yet</h2><p className="mt-1 text-sm text-neutral-500">Create an event to share your availability.</p></div> : listEvents.map((event, i) => <article key={event.id} className={clsx(!event.enabled && "opacity-65", `relative flex flex-wrap items-center gap-4 rounded-md bg-white px-5 py-5 max-md:gap-3 max-md:rounded-none max-md:border-b max-md:border-neutral-100 max-md:px-0 max-md:py-4 max-md:last:border-b-0`, i === 0 && "rounded-t-3xl")}>- <div className="flex min-w-0 flex-1 items-start gap-4"><span className={`mt-1 flex h-5 w-5 shrink-0 items-center justify-center rounded-md border ${event.enabled ? "border-blue-600 bg-blue-600 text-white" : "border-neutral-300"}`}>{event.enabled && <Check className="h-3.5 w-3.5" />}</span><div className="min-w-0"><button type="button" onClick={() => startEdit(event)} className="text-left text-lg font-semibold text-neutral-900 hover:text-blue-700 max-md:text-base">{event.name}</button>{event.description && <p className="mt-1 line-clamp-2 whitespace-pre-wrap text-sm text-neutral-600">{event.description}</p>}<p className="mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-neutral-500"><span className="inline-flex items-center gap-1"><Clock3 className="h-3.5 w-3.5" />{durationLabel(event.durationMinutes)}</span><span>·</span><span className="inline-flex items-center gap-1"><MapPin className="h-3.5 w-3.5" />{event.location || "No location set"}</span></p><p className="mt-2 text-sm text-neutral-500">{availabilityLabel(event)}</p></div></div>- <div className="ml-auto flex items-center gap-2 max-md:ml-9 max-md:w-full">{event.enabled ? <><Button type="button" variant="outline" onClick={() => void copyLink(event)} className="h-9 rounded-full px-3"><Copy className="h-4 w-4" />Copy link</Button>{username && <Link href={`/c/${username}/${event.slug}`} target="_blank" aria-label={`Open booking page for ${event.name}`} className="rounded-full p-2 text-neutral-600 hover:bg-neutral-100"><ExternalLink className="h-4 w-4" /></Link>}</> : <Button type="button" variant="outline" disabled={event.isTemplate && savingTemplateId !== null} onClick={() => void setEnabled(event, true)} className="h-9 rounded-full px-3">{savingTemplateId === event.id ? "Turning on…" : "Turn on"}</Button>}- {!event.isTemplate && <div className="relative"><button type="button" aria-label={`More options for ${event.name}`} aria-expanded={menuId === event.id} onClick={() => setMenuId(menuId === event.id ? null : event.id)} className="rounded-full p-2 text-neutral-600 hover:bg-neutral-100"><MoreHorizontal className="h-5 w-5" /></button>{menuId === event.id && <div className="absolute right-0 top-10 z-10 w-36 rounded-xl border border-neutral-200 bg-white p-1 shadow-lg"><button type="button" onClick={() => startEdit(event)} className="block w-full rounded-lg px-3 py-2 text-left text-sm hover:bg-neutral-100">Edit</button><button type="button" onClick={() => void setEnabled(event, !event.enabled)} className="block w-full rounded-lg px-3 py-2 text-left text-sm hover:bg-neutral-100">Turn {event.enabled ? "off" : "on"}</button><button type="button" onClick={() => void remove(event)} className="block w-full rounded-lg px-3 py-2 text-left text-sm text-red-600 hover:bg-red-50">Delete</button></div>}</div>}</div>+ {loading ? <BookingListSkeleton /> : listEvents.length === 0 ? <div className="rounded-2xl border border-dashed border-neutral-300 bg-white px-6 py-12 text-center"><CalendarDays className="mx-auto mb-3 h-8 w-8 text-neutral-400" /><h2 className="font-medium text-neutral-900">{t("booking.none")}</h2><p className="mt-1 text-sm text-neutral-500">{t("booking.noneHint")}</p></div> : listEvents.map((event, i) => <article key={event.id} className={clsx(!event.enabled && "opacity-65", `relative flex flex-wrap items-center gap-4 rounded-md bg-white px-5 py-5 max-md:gap-3 max-md:rounded-none max-md:border-b max-md:border-neutral-100 max-md:px-0 max-md:py-4 max-md:last:border-b-0`, i === 0 && "rounded-t-3xl")}>+ <div className="flex min-w-0 flex-1 items-start gap-4"><span className={`mt-1 flex h-5 w-5 shrink-0 items-center justify-center rounded-md border ${event.enabled ? "border-blue-600 bg-blue-600 text-white" : "border-neutral-300"}`}>{event.enabled && <Check className="h-3.5 w-3.5" />}</span><div className="min-w-0"><button type="button" onClick={() => startEdit(event)} className="text-left text-lg font-semibold text-neutral-900 hover:text-blue-700 max-md:text-base">{event.name}</button>{event.description && <p className="mt-1 line-clamp-2 whitespace-pre-wrap text-sm text-neutral-600">{event.description}</p>}<p className="mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-neutral-500"><span className="inline-flex items-center gap-1"><Clock3 className="h-3.5 w-3.5" />{durationLabel(event.durationMinutes, t)}</span><span>·</span><span className="inline-flex items-center gap-1"><MapPin className="h-3.5 w-3.5" />{event.location || t("booking.noLocation")}</span></p><p className="mt-2 text-sm text-neutral-500">{availabilityLabel(event, t)}</p></div></div>+ <div className="ml-auto flex items-center gap-2 max-md:ml-9 max-md:w-full">{event.enabled ? <><Button type="button" variant="outline" onClick={() => void copyLink(event)} className="h-9 rounded-full px-3"><Copy className="h-4 w-4" />{t("booking.copyLink")}</Button>{username && <Link href={`/c/${username}/${event.slug}`} target="_blank" aria-label={t("booking.openPage", { name: event.name })} className="rounded-full p-2 text-neutral-600 hover:bg-neutral-100"><ExternalLink className="h-4 w-4" /></Link>}</> : <Button type="button" variant="outline" disabled={event.isTemplate && savingTemplateId !== null} onClick={() => void setEnabled(event, true)} className="h-9 rounded-full px-3">{savingTemplateId === event.id ? t("booking.turningOn") : t("booking.turnOn")}</Button>}+ {!event.isTemplate && <div className="relative"><button type="button" aria-label={t("booking.moreOptions", { name: event.name })} aria-expanded={menuId === event.id} onClick={() => setMenuId(menuId === event.id ? null : event.id)} className="rounded-full p-2 text-neutral-600 hover:bg-neutral-100"><MoreHorizontal className="h-5 w-5" /></button>{menuId === event.id && <div className="absolute right-0 top-10 z-10 w-36 rounded-xl border border-neutral-200 bg-white p-1 shadow-lg"><button type="button" onClick={() => startEdit(event)} className="block w-full rounded-lg px-3 py-2 text-left text-sm hover:bg-neutral-100">{t("booking.edit")}</button><button type="button" onClick={() => void setEnabled(event, !event.enabled)} className="block w-full rounded-lg px-3 py-2 text-left text-sm hover:bg-neutral-100">{event.enabled ? t("booking.turnOff") : t("booking.turnOn")}</button><button type="button" onClick={() => void remove(event)} className="block w-full rounded-lg px-3 py-2 text-left text-sm text-red-600 hover:bg-red-50">{t("common.delete")}</button></div>}</div>}</div></article>)}</section></div>diff --git a/src/app/(calendar)/booking/utils.ts b/src/app/(calendar)/booking/utils.tsindex 0ed6603..dc19a32 100644--- a/src/app/(calendar)/booking/utils.ts+++ b/src/app/(calendar)/booking/utils.ts@@ -1,3 +1,5 @@+import type { TranslationKey } from "@/lib/i18n/types";+import { defaultTranslator, type Translator } from "@/lib/i18n/utils";import type { BookingEvent, BookingForm, BookingHost, BookingHostMatch } from "./types";import { parseBookingTimeRanges } from "@/lib/booking/utils";import { timeToMinutes } from "@/lib/booking/utils";@@ -7,15 +9,7 @@ import { normalizeCalendarColor } from "@/lib/calendar/colors";import { slugifyBookingName } from "@/lib/booking/utils";import { parseBookingHostIds } from "@/lib/booking/hosts";-export const WEEKDAYS = [- { value: 0, short: "Sun", label: "Sunday" },- { value: 1, short: "Mon", label: "Monday" },- { value: 2, short: "Tue", label: "Tuesday" },- { value: 3, short: "Wed", label: "Wednesday" },- { value: 4, short: "Thu", label: "Thursday" },- { value: 5, short: "Fri", label: "Friday" },- { value: 6, short: "Sat", label: "Saturday" },-];+export const WEEKDAYS = [0, 1, 2, 3, 4, 5, 6] as const;export function emptyBookingForm(timeZone: string, currentUserId: string): BookingForm {return { name: "", slug: "", description: "", color: DEFAULT_FOLDER_COLOR, hostIds: [currentUserId], durationMinutes: 30, location: "", weekdays: [1, 2, 3, 4, 5], startTime: "09:00", endTime: "17:00", timeRanges: [{ startTime: "09:00", endTime: "17:00" }], timeZone, enabled: true };@@ -31,34 +25,34 @@ export function bookingFormWithName(form: BookingForm, name: string): BookingForreturn { ...form, name, slug: !form.slug || form.slug === slugifyBookingName(form.name) ? slugifyBookingName(name) : form.slug };}-export function matchBookingHost(hosts: BookingHost[], value: string): BookingHostMatch {+export function matchBookingHost(hosts: BookingHost[], value: string, t: Translator = defaultTranslator): BookingHostMatch {const query = value.trim().toLowerCase();- if (!query) return { host: null, error: "Enter a name or email." };+ if (!query) return { host: null, error: t("booking.host.enterNameOrEmail") };if (query.includes("@")) {const host = hosts.find((item) => item.email.toLowerCase() === query);- return host ? { host, error: "" } : { host: null, error: "Invalid email" };+ return host ? { host, error: "" } : { host: null, error: t("booking.host.invalidEmail") };}const matches = hosts.filter((item) => item.name.toLowerCase() === query || item.name.toLowerCase().startsWith(query));if (matches.length === 1) return { host: matches[0], error: "" };- return { host: null, error: matches.length ? "More than one user matches. Enter their email address." : "No user with that name is in your user list." };+ return { host: null, error: matches.length ? t("booking.host.multiple") : t("booking.host.notFound") };}-export function durationLabel(minutes: number): string {- return minutes === 60 ? "1 hour" : minutes > 60 && minutes % 60 === 0 ? `${minutes / 60} hours` : `${minutes} min`;+export function durationLabel(minutes: number, t: Translator = defaultTranslator): string {+ return minutes === 60 ? t("booking.duration.hour") : minutes > 60 && minutes % 60 === 0 ? t("booking.duration.hours", { count: minutes / 60 }) : t("booking.duration.min", { count: minutes });}-export function availabilityLabel(event: BookingEvent): string {+export function availabilityLabel(event: BookingEvent, t: Translator = defaultTranslator): string {const { weekdays } = formFromEvent(event);- if (!weekdays.length) return "No days selected";- const days = weekdays.map((day) => WEEKDAYS.find((item) => item.value === day)?.short).filter(Boolean).join(", ");+ if (!weekdays.length) return t("booking.noDays");+ const days = weekdays.map((day) => t(`calendar.weekdayShort.${day}` as TranslationKey)).join(", ");const ranges = parseBookingTimeRanges(event.timeRanges, { startTime: event.startTime, endTime: event.endTime });return `${days} · ${ranges.map((range) => `${range.startTime}–${range.endTime}`).join(", ")}`;}-export function formAvailabilityLabel(form: BookingForm): string {- if (!form.weekdays.length) return "No days selected";- const days = form.weekdays.map((day) => WEEKDAYS.find((item) => item.value === day)?.short).filter(Boolean).join(", ");- return `${days} · ${form.timeRanges.length === 1 ? `${form.timeRanges[0].startTime}–${form.timeRanges[0].endTime}` : `${form.timeRanges.length} time windows`}`;+export function formAvailabilityLabel(form: BookingForm, t: Translator = defaultTranslator): string {+ if (!form.weekdays.length) return t("booking.noDays");+ const days = form.weekdays.map((day) => t(`calendar.weekdayShort.${day}` as TranslationKey)).join(", ");+ return `${days} · ${form.timeRanges.length === 1 ? `${form.timeRanges[0].startTime}–${form.timeRanges[0].endTime}` : t("booking.timeWindows", { count: form.timeRanges.length })}`;}export function nextBookingTimeRange(ranges: BookingTimeRange[], durationMinutes: number): BookingTimeRange {diff --git a/src/app/(calendar)/calendar/day-events.tsx b/src/app/(calendar)/calendar/day-events.tsxindex 89ff93b..7533307 100644--- a/src/app/(calendar)/calendar/day-events.tsx+++ b/src/app/(calendar)/calendar/day-events.tsx@@ -3,6 +3,7 @@import { Fragment, memo, useMemo } from "react";import type { DragEvent, PointerEvent as ReactPointerEvent } from "react";import clsx from "clsx";+import { useLanguage } from "@/components/language-provider";import { normalizeCalendarColor } from "@/lib/calendar/colors";import { addDays, dateKey, EVENT_COLOR_CLASSES, eventPosition, formatEventRange, PAST_EVENT_COLOR_CLASSES } from "./utils";import type { CalendarEvent, EventResizeEdge } from "./types";@@ -11,6 +12,7 @@ import type { DayEventsProps } from "./day-events-types";// Memoized so pointer-move / drag-over preview updates in the page do not// recompute positions (timezone math) and re-render every event block.function DayEventsImpl({ day, events, currentTime, busy, activeEventId, onEdit, onDragStart, onDragEnd, onResizeStart, onResizeMove, onResizeEnd, onResizeCancel }: DayEventsProps) {+ const { t } = useLanguage();const nextDay = useMemo(() => addDays(day, 1), [day]);const items = useMemo(() => events.flatMap((event) => {if (!(new Date(event.startsAt) < nextDay && new Date(event.endsAt) > day)) return [];@@ -47,7 +49,7 @@ function DayEventsImpl({ day, events, currentTime, busy, activeEventId, onEdit,</button>{edges.map((edge: EventResizeEdge) => (<button key={edge} type="button" draggable={false}- aria-label={`Resize ${edge} of ${event.title}`}+ aria-label={t(edge === "start" ? "calendar.resizeEdge.start" : "calendar.resizeEdge.end", { title: event.title })}onPointerDown={(pointerEvent: ReactPointerEvent<HTMLButtonElement>) => onResizeStart(pointerEvent, event, day, edge)}onPointerMove={onResizeMove}onPointerUp={onResizeEnd}diff --git a/src/app/(calendar)/calendar/utils.ts b/src/app/(calendar)/calendar/utils.tsindex 2c689cf..b2ad7a5 100644--- a/src/app/(calendar)/calendar/utils.ts+++ b/src/app/(calendar)/calendar/utils.ts@@ -1,3 +1,4 @@+import { defaultTranslator, type Translator } from "@/lib/i18n/utils";import type { CalendarEvent, CalendarEventTimes, EventGroup, EventResizeEdge } from "./types";import type { FolderColor } from "@/lib/folders/types";import type { CalendarRepeat } from "@/lib/calendar/types";@@ -196,7 +197,7 @@ export function formatEventRange(event: CalendarEvent): string {return `${formatEventTime(start)} – ${formatEventTime(end)}`;}-export function groupUpcomingEvents(events: CalendarEvent[], today: Date): EventGroup[] {+export function groupUpcomingEvents(events: CalendarEvent[], today: Date, t: Translator = defaultTranslator): EventGroup[] {const todayStart = startOfDay(today);const tomorrowStart = addDays(todayStart, 1);const groups: EventGroup[] = [];@@ -206,9 +207,9 @@ export function groupUpcomingEvents(events: CalendarEvent[], today: Date): Eventif (eventDate < todayStart) continue;const key = dateKey(eventDate);const label = key === dateKey(todayStart)- ? "Today"+ ? t("calendar.today"): key === dateKey(tomorrowStart)- ? "Tomorrow"+ ? t("calendar.tomorrow"): formatUserDate(eventDate, { month: "short", day: "numeric", year: "numeric" });const lastGroup = groups[groups.length - 1];if (lastGroup?.key === key) lastGroup.events.push(event);diff --git a/src/app/(calendar)/layout.tsx b/src/app/(calendar)/layout.tsxindex e4fa3cf..7fc5cf7 100644--- a/src/app/(calendar)/layout.tsx+++ b/src/app/(calendar)/layout.tsx@@ -4,6 +4,7 @@ import { useEffect } from "react";import Link from "next/link";import { usePathname, useRouter } from "next/navigation";import { ChevronDown, Sparkles } from "lucide-react";+import { useLanguage } from "@/components/language-provider";import { AgentPanel } from "@/components/agent/agent-panel";import { AssistantOpenContext } from "@/components/agent/assistant-open-state";import { AuthGuard } from "@/components/auth/auth-guard";@@ -24,6 +25,7 @@ import { useDashboardState } from "../(dashboard)/dashboard-state";import { useAssistantAvailability } from "../(dashboard)/use-assistant-availability";export default function CalendarLayout({ children }: { children: React.ReactNode }) {+ const { t } = useLanguage();const pathname = usePathname();const router = useRouter();const { assistantOpen, setAssistantOpen, assistantFullSize, setAssistantFullSize } = useDashboardState();@@ -50,16 +52,16 @@ export default function CalendarLayout({ children }: { children: React.ReactNode<header className="flex h-16 w-full shrink-0 items-center gap-3 pr-4 text-sm max-md:h-auto max-md:flex-wrap max-md:gap-x-2 max-md:gap-y-2 max-md:pb-2 max-md:pr-2 max-md:pt-1"><MobileMenuButton className="ml-1" /><div className="hidden shrink-0 px-3 md:block [&>div]:mb-0" style={{ width: "calc(var(--sidebar-width) + 1.5rem)" }}><SidebarHeader href="/inbox" /></div>- <div className="min-w-0 flex-1 basis-0 md:hidden"><div className="relative w-fit max-w-full"><select aria-label="Calendar section" value={pathname === "/booking" ? "/booking" : "/calendar"} onChange={(event) => router.push(event.target.value)} className="h-8 max-w-full appearance-none rounded-full border-0 bg-white pl-3 pr-8 text-sm font-medium text-neutral-700"><option value="/booking">Bookings</option><option value="/calendar">Calendar</option></select><ChevronDown className="pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-600" /></div></div>+ <div className="min-w-0 flex-1 basis-0 md:hidden"><div className="relative w-fit max-w-full"><select aria-label={t("calendar.sectionLabel")} value={pathname === "/booking" ? "/booking" : "/calendar"} onChange={(event) => router.push(event.target.value)} className="h-8 max-w-full appearance-none rounded-full border-0 bg-white pl-3 pr-8 text-sm font-medium text-neutral-700"><option value="/booking">{t("calendar.bookings")}</option><option value="/calendar">{t("calendar.calendar")}</option></select><ChevronDown className="pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-600" /></div></div><div className="flex min-w-0 flex-1 items-center gap-3 md:overflow-x-auto max-md:contents">- <nav aria-label="Calendar sections" className="flex shrink-0 max-md:hidden items-center rounded-full bg-white p-1">- <Link href="/booking" aria-current={pathname === "/booking" ? "page" : undefined} className={clsx("rounded-full px-4 py-2 text-sm font-medium transition-colors", pathname === "/booking" ? "bg-blue-600 text-white" : "text-neutral-600 hover:bg-neutral-100")}>Bookings</Link>- <Link href="/calendar" aria-current={pathname === "/calendar" ? "page" : undefined} className={clsx("rounded-full px-4 py-2 text-sm font-medium transition-colors", pathname === "/calendar" ? "bg-blue-600 text-white" : "text-neutral-600 hover:bg-neutral-100")}>Calendar</Link>+ <nav aria-label={t("calendar.sections")} className="flex shrink-0 max-md:hidden items-center rounded-full bg-white p-1">+ <Link href="/booking" aria-current={pathname === "/booking" ? "page" : undefined} className={clsx("rounded-full px-4 py-2 text-sm font-medium transition-colors", pathname === "/booking" ? "bg-blue-600 text-white" : "text-neutral-600 hover:bg-neutral-100")}>{t("calendar.bookings")}</Link>+ <Link href="/calendar" aria-current={pathname === "/calendar" ? "page" : undefined} className={clsx("rounded-full px-4 py-2 text-sm font-medium transition-colors", pathname === "/calendar" ? "bg-blue-600 text-white" : "text-neutral-600 hover:bg-neutral-100")}>{t("calendar.calendar")}</Link></nav><div id="calendar-header-slot" className="flex min-w-0 flex-1 items-center md:min-w-max max-md:order-last max-md:basis-full max-md:pl-3 max-md:empty:hidden" /></div><LicenseIndicator />- {assistantEnabled && <Button type="button" variant="ghost" size="sm" className={assistantOpen ? "bg-blue-50 text-blue-700" : "text-neutral-600"} onClick={() => { setAssistantOpen((current) => !current); setAssistantFullSize(false); }} aria-label={assistantOpen ? "Close email assistant" : "Open email assistant"} aria-expanded={assistantOpen} aria-controls="email-assistant-panel"><Sparkles className="h-5 w-5" /></Button>}+ {assistantEnabled && <Button type="button" variant="ghost" size="sm" className={assistantOpen ? "bg-blue-50 text-blue-700" : "text-neutral-600"} onClick={() => { setAssistantOpen((current) => !current); setAssistantFullSize(false); }} aria-label={assistantOpen ? t("agent.assistant.close") : t("agent.assistant.open")} aria-expanded={assistantOpen} aria-controls="email-assistant-panel"><Sparkles className="h-5 w-5" /></Button>}<MailboxSelector /></header><div className="flex min-h-0 min-w-0 flex-1 overflow-hidden">diff --git a/src/app/(calendar)/upcoming-sidebar.tsx b/src/app/(calendar)/upcoming-sidebar.tsxindex a12efe2..a792eaa 100644--- a/src/app/(calendar)/upcoming-sidebar.tsx+++ b/src/app/(calendar)/upcoming-sidebar.tsx@@ -3,6 +3,7 @@import { useEffect, useMemo, useRef, useState } from "react";import { useRouter } from "next/navigation";import clsx from "clsx";+import { useLanguage } from "@/components/language-provider";import { SidebarResizeBoundary } from "@/components/sidebar-resize-boundary";import { useSidebar } from "@/components/sidebar-state";import { authFetch } from "@/lib/auth/client";@@ -12,6 +13,7 @@ import { addDays, expandCalendarEvents, formatEventRange, groupUpcomingEvents, simport type { UpcomingSidebarProps } from "./upcoming-sidebar-types";export function UpcomingSidebar({ events, onSelect, drawer = false, refreshKey }: UpcomingSidebarProps) {+ const { t } = useLanguage();const { minimal: sidebarMinimal, mobile } = useSidebar();// The drawer variant is always expanded; it only mounts while the mobile menu is open.const minimal = !drawer && (sidebarMinimal || mobile);@@ -24,7 +26,7 @@ export function UpcomingSidebar({ events, onSelect, drawer = false, refreshKey }const sentinelRef = useRef<HTMLDivElement | null>(null);const today = useMemo(() => startOfDay(new Date()), []);const shownEvents = events ?? loadedEvents;- const groups = useMemo(() => groupUpcomingEvents(shownEvents, today), [shownEvents, today]);+ const groups = useMemo(() => groupUpcomingEvents(shownEvents, today, t), [shownEvents, today, t]);const total = useMemo(() => groups.reduce((count, group) => count + group.events.length, 0), [groups]);const visibleGroups = useMemo(() => takeUpcomingGroups(groups, visibleCount), [groups, visibleCount]);@@ -56,9 +58,9 @@ export function UpcomingSidebar({ events, onSelect, drawer = false, refreshKey }}, [minimal, total, visibleCount]);const awaiting = events === undefined && !loaded && !loadError;- const SKELETON = <div className="space-y-6" aria-label="Loading upcoming events" aria-busy="true">{[0, 1].map((group) => <div key={group} className="animate-pulse"><div className="mb-3 h-4 w-28 rounded bg-neutral-200" /><div className="space-y-3">{[0, 1, 2].map((row) => <div key={row} className="flex items-start gap-3"><span className="mt-0.5 h-4 w-4 shrink-0 rounded-full bg-neutral-200" /><span className="min-w-0 flex-1 space-y-1.5"><span className="block h-3.5 w-3/4 rounded bg-neutral-200" /><span className="block h-3 w-1/2 rounded bg-neutral-100" /></span></div>)}</div></div>)}</div>;+ const SKELETON = <div className="space-y-6" aria-label={t("calendar.loadingUpcoming")} aria-busy="true">{[0, 1].map((group) => <div key={group} className="animate-pulse"><div className="mb-3 h-4 w-28 rounded bg-neutral-200" /><div className="space-y-3">{[0, 1, 2].map((row) => <div key={row} className="flex items-start gap-3"><span className="mt-0.5 h-4 w-4 shrink-0 rounded-full bg-neutral-200" /><span className="min-w-0 flex-1 space-y-1.5"><span className="block h-3.5 w-3/4 rounded bg-neutral-200" /><span className="block h-3 w-1/2 rounded bg-neutral-100" /></span></div>)}</div></div>)}</div>;const list = !minimal && <div ref={scrollRef} className="h-full overflow-y-auto overscroll-contain rounded-t-3xl px-5 py-5">- {awaiting ? SKELETON : groups.length === 0 ? <div><h2 className="text-lg font-semibold text-neutral-900">Upcoming</h2><p className="mt-4 text-sm text-neutral-400">{loadError ? "Could not load upcoming events." : "No upcoming events."}</p></div> : visibleGroups.map((group) => <section key={group.key} className="mb-6 last:mb-0"><h2 className="sticky -top-5 z-10 -mx-5 mb-2 bg-white px-5 py-2 text-base font-semibold text-neutral-900">{group.label}</h2><div className="space-y-2">{group.events.map((event) => <button key={event.id} type="button" onClick={() => onSelect ? onSelect(event) : router.push(`/calendar?event=${encodeURIComponent(event.id)}`)} className="group flex w-full items-start gap-3 text-left"><span className="mt-0.5 h-4 w-4 shrink-0 rounded-full border-2 border-white ring-1 ring-neutral-200" style={{ backgroundColor: normalizeCalendarColor(event.color) }} /><span className="min-w-0"><span className="block truncate text-sm text-neutral-700 group-hover:text-neutral-950">{event.title}</span><span className="block text-xs text-neutral-400">{formatEventRange(event)}</span></span></button>)}</div></section>)}+ {awaiting ? SKELETON : groups.length === 0 ? <div><h2 className="text-lg font-semibold text-neutral-900">{t("calendar.upcoming")}</h2><p className="mt-4 text-sm text-neutral-400">{loadError ? t("calendar.upcomingLoadFailed") : t("calendar.noUpcoming")}</p></div> : visibleGroups.map((group) => <section key={group.key} className="mb-6 last:mb-0"><h2 className="sticky -top-5 z-10 -mx-5 mb-2 bg-white px-5 py-2 text-base font-semibold text-neutral-900">{group.label}</h2><div className="space-y-2">{group.events.map((event) => <button key={event.id} type="button" onClick={() => onSelect ? onSelect(event) : router.push(`/calendar?event=${encodeURIComponent(event.id)}`)} className="group flex w-full items-start gap-3 text-left"><span className="mt-0.5 h-4 w-4 shrink-0 rounded-full border-2 border-white ring-1 ring-neutral-200" style={{ backgroundColor: normalizeCalendarColor(event.color) }} /><span className="min-w-0"><span className="block truncate text-sm text-neutral-700 group-hover:text-neutral-950">{event.title}</span><span className="block text-xs text-neutral-400">{formatEventRange(event)}</span></span></button>)}</div></section>)}{visibleCount < total && <div ref={sentinelRef} aria-hidden="true" className="h-1" />}</div>;diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.jsonindex 37f4ab3..fedda3d 100644--- a/src/lib/i18n/en.json+++ b/src/lib/i18n/en.json@@ -1540,5 +1540,91 @@"calendar.location": "Location","calendar.addDescription": "Add description","calendar.description": "Description",- "calendar.eventColor": "Event color"+ "calendar.eventColor": "Event color",+ "calendar.upcoming": "Upcoming",+ "calendar.upcomingLoadFailed": "Could not load upcoming events.",+ "calendar.noUpcoming": "No upcoming events.",+ "calendar.loadingUpcoming": "Loading upcoming events",+ "calendar.tomorrow": "Tomorrow",+ "calendar.sectionLabel": "Calendar section",+ "calendar.bookings": "Bookings",+ "calendar.calendar": "Calendar",+ "calendar.sections": "Calendar sections",+ "calendar.resizeEdge.start": "Resize start of {title}",+ "calendar.resizeEdge.end": "Resize end of {title}",+ "booking.hostListFailed": "Could not load the user list.",+ "booking.loadFailed": "Could not load bookings.",+ "booking.saveFailed": "Could not save booking event.",+ "booking.saved": "Booking event saved.",+ "booking.created": "Booking event created.",+ "booking.enableFailed": "Could not enable booking event.",+ "booking.updateFailed": "Could not update booking event.",+ "booking.deleteConfirm": "Delete “{name}”?",+ "booking.deleteFailed": "Could not delete booking event.",+ "booking.usernameUnavailable": "Booking username is unavailable.",+ "booking.linkCopied": "Booking link copied.",+ "booking.copyFailed": "Could not copy booking link.",+ "booking.events": "Booking events",+ "booking.title": "Bookings",+ "booking.description": "Set the meetings people can book with you.",+ "booking.newEvent": "New event",+ "booking.none": "No booking events yet",+ "booking.noneHint": "Create an event to share your availability.",+ "booking.noLocation": "No location set",+ "booking.copyLink": "Copy link",+ "booking.openPage": "Open booking page for {name}",+ "booking.turningOn": "Turning on…",+ "booking.turnOn": "Turn on",+ "booking.turnOff": "Turn off",+ "booking.moreOptions": "More options for {name}",+ "booking.edit": "Edit",+ "booking.duration.hour": "1 hour",+ "booking.duration.hours": "{count} hours",+ "booking.duration.min": "{count} min",+ "booking.noDays": "No days selected",+ "booking.timeWindows": "{count} time windows",+ "booking.host.enterNameOrEmail": "Enter a name or email.",+ "booking.host.invalidEmail": "Invalid email",+ "booking.host.multiple": "More than one user matches. Enter their email address.",+ "booking.host.notFound": "No user with that name is in your user list.",+ "booking.editor.details": "Event details",+ "booking.editor.editColor": "Edit event color",+ "booking.editor.meetingName": "Meeting name",+ "booking.editor.newMeeting": "New meeting",+ "booking.editor.toggleDetails": "Toggle event details",+ "booking.editor.slug": "Link slug",+ "booking.editor.slugPlaceholder": "new-meeting",+ "booking.editor.yourName": "your-name",+ "booking.editor.eventSlug": "event-slug",+ "booking.editor.descriptionPlaceholder": "Tell guests what this meeting is about",+ "booking.editor.color": "Color",+ "booking.editor.duration": "Duration",+ "booking.editor.meetingLength": "Meeting length",+ "booking.editor.minutes15": "15 minutes",+ "booking.editor.minutes30": "30 minutes",+ "booking.editor.minutes45": "45 minutes",+ "booking.editor.hour1": "1 hour",+ "booking.editor.custom": "Custom",+ "booking.editor.customMinutes": "Custom minutes",+ "booking.editor.location": "Location",+ "booking.editor.locationPlaceholder": "Phone call, video link, or address",+ "booking.editor.availability": "Availability",+ "booking.editor.availableDays": "Available days",+ "booking.editor.times": "Times",+ "booking.editor.removeTime": "Remove time {n}",+ "booking.editor.addTime": "Add time",+ "booking.editor.timesUse": "Times use {zone}.",+ "booking.editor.host": "Host",+ "booking.editor.unavailableUser": "Unavailable user",+ "booking.editor.you": " (you)",+ "booking.editor.alreadyHost": "This user is already a host.",+ "booking.editor.maxHosts": "A booking can have up to 20 hosts.",+ "booking.editor.addHost": "Add a host",+ "booking.editor.nameOrEmail": "Name or email",+ "booking.editor.add": "Add",+ "booking.editor.userFallback": "User",+ "booking.editor.more": "More",+ "booking.editor.create": "Create",+ "booking.loading": "Loading bookings",+ "booking.loadingEllipsis": "Loading bookings…"}diff --git a/src/lib/i18n/pt-BR.json b/src/lib/i18n/pt-BR.jsonindex 567762a..c82c4f1 100644--- a/src/lib/i18n/pt-BR.json+++ b/src/lib/i18n/pt-BR.json@@ -1540,5 +1540,91 @@"calendar.location": "Local","calendar.addDescription": "Adicionar descrição","calendar.description": "Descrição",- "calendar.eventColor": "Cor do evento"+ "calendar.eventColor": "Cor do evento",+ "calendar.upcoming": "Próximos",+ "calendar.upcomingLoadFailed": "Não foi possível carregar os próximos eventos.",+ "calendar.noUpcoming": "Nenhum evento próximo.",+ "calendar.loadingUpcoming": "Carregando próximos eventos",+ "calendar.tomorrow": "Amanhã",+ "calendar.sectionLabel": "Seção do calendário",+ "calendar.bookings": "Agendamentos",+ "calendar.calendar": "Calendário",+ "calendar.sections": "Seções do calendário",+ "calendar.resizeEdge.start": "Redimensionar o início de {title}",+ "calendar.resizeEdge.end": "Redimensionar o fim de {title}",+ "booking.hostListFailed": "Não foi possível carregar a lista de usuários.",+ "booking.loadFailed": "Não foi possível carregar os agendamentos.",+ "booking.saveFailed": "Não foi possível salvar o evento de agendamento.",+ "booking.saved": "Evento de agendamento salvo.",+ "booking.created": "Evento de agendamento criado.",+ "booking.enableFailed": "Não foi possível ativar o evento de agendamento.",+ "booking.updateFailed": "Não foi possível atualizar o evento de agendamento.",+ "booking.deleteConfirm": "Excluir “{name}”?",+ "booking.deleteFailed": "Não foi possível excluir o evento de agendamento.",+ "booking.usernameUnavailable": "O nome de usuário de agendamento não está disponível.",+ "booking.linkCopied": "Link de agendamento copiado.",+ "booking.copyFailed": "Não foi possível copiar o link de agendamento.",+ "booking.events": "Eventos de agendamento",+ "booking.title": "Agendamentos",+ "booking.description": "Defina as reuniões que as pessoas podem agendar com você.",+ "booking.newEvent": "Novo evento",+ "booking.none": "Nenhum evento de agendamento ainda",+ "booking.noneHint": "Crie um evento para compartilhar sua disponibilidade.",+ "booking.noLocation": "Nenhum local definido",+ "booking.copyLink": "Copiar link",+ "booking.openPage": "Abrir a página de agendamento de {name}",+ "booking.turningOn": "Ativando…",+ "booking.turnOn": "Ativar",+ "booking.turnOff": "Desativar",+ "booking.moreOptions": "Mais opções para {name}",+ "booking.edit": "Editar",+ "booking.duration.hour": "1 hora",+ "booking.duration.hours": "{count} horas",+ "booking.duration.min": "{count} min",+ "booking.noDays": "Nenhum dia selecionado",+ "booking.timeWindows": "{count} janelas de horário",+ "booking.host.enterNameOrEmail": "Digite um nome ou e-mail.",+ "booking.host.invalidEmail": "E-mail inválido",+ "booking.host.multiple": "Mais de um usuário corresponde. Digite o endereço de e-mail.",+ "booking.host.notFound": "Nenhum usuário com esse nome está na sua lista de usuários.",+ "booking.editor.details": "Detalhes do evento",+ "booking.editor.editColor": "Editar a cor do evento",+ "booking.editor.meetingName": "Nome da reunião",+ "booking.editor.newMeeting": "Nova reunião",+ "booking.editor.toggleDetails": "Alternar detalhes do evento",+ "booking.editor.slug": "Slug do link",+ "booking.editor.slugPlaceholder": "nova-reuniao",+ "booking.editor.yourName": "seu-nome",+ "booking.editor.eventSlug": "slug-do-evento",+ "booking.editor.descriptionPlaceholder": "Conte aos convidados do que se trata esta reunião",+ "booking.editor.color": "Cor",+ "booking.editor.duration": "Duração",+ "booking.editor.meetingLength": "Duração da reunião",+ "booking.editor.minutes15": "15 minutos",+ "booking.editor.minutes30": "30 minutos",+ "booking.editor.minutes45": "45 minutos",+ "booking.editor.hour1": "1 hora",+ "booking.editor.custom": "Personalizado",+ "booking.editor.customMinutes": "Minutos personalizados",+ "booking.editor.location": "Local",+ "booking.editor.locationPlaceholder": "Ligação, link de vídeo ou endereço",+ "booking.editor.availability": "Disponibilidade",+ "booking.editor.availableDays": "Dias disponíveis",+ "booking.editor.times": "Horários",+ "booking.editor.removeTime": "Remover horário {n}",+ "booking.editor.addTime": "Adicionar horário",+ "booking.editor.timesUse": "Os horários usam {zone}.",+ "booking.editor.host": "Anfitrião",+ "booking.editor.unavailableUser": "Usuário indisponível",+ "booking.editor.you": " (você)",+ "booking.editor.alreadyHost": "Este usuário já é um anfitrião.",+ "booking.editor.maxHosts": "Um agendamento pode ter até 20 anfitriões.",+ "booking.editor.addHost": "Adicionar um anfitrião",+ "booking.editor.nameOrEmail": "Nome ou e-mail",+ "booking.editor.add": "Adicionar",+ "booking.editor.userFallback": "Usuário",+ "booking.editor.more": "Mais",+ "booking.editor.create": "Criar",+ "booking.loading": "Carregando agendamentos",+ "booking.loadingEllipsis": "Carregando agendamentos…"}