Use American English spelling throughout
This commit is contained in:
@@ -24,7 +24,7 @@ interface Props {
|
||||
onCreate: (start: Date, end: Date, allDay: boolean) => void;
|
||||
}
|
||||
|
||||
/** Resolve the display colour of an event: explicit colour → category colour → calendar colour. */
|
||||
/** Resolve the display color of an event: explicit color → category color → calendar color. */
|
||||
export function eventColor(ev: CalendarEvent, calendarColor: string | null | undefined, categories: Array<{ name: string; color: string }>): string {
|
||||
if (ev.color) return ev.color;
|
||||
const cat = categoryOf(ev, categories);
|
||||
@@ -77,10 +77,10 @@ export function CalendarContextMenu({ ctx, onClose, onOpen, onEdit, onCreate }:
|
||||
toast.error((err as Error).message);
|
||||
}
|
||||
};
|
||||
const setColor = (color: string | null) => void patch({ color }, color ? t("Colour updated") : t("Custom colour removed"));
|
||||
const setColor = (color: string | null) => void patch({ color }, color ? t("Color updated") : t("Custom color removed"));
|
||||
const setCategory = (cat: { name: string; color: string } | null) => {
|
||||
const categoriesPatch = cat ? { [cat.name]: true } : null;
|
||||
void patch({ categories: categoriesPatch, color: cat ? cat.color : null }, cat ? t("Categorised as {name}", { name: cat.name }) : t("Category cleared"));
|
||||
void patch({ categories: categoriesPatch, color: cat ? cat.color : null }, cat ? t("Categorized as {name}", { name: cat.name }) : t("Category cleared"));
|
||||
};
|
||||
const duplicate = async () => {
|
||||
const { id: _i, baseEventId: _b, uid: _u, utcStart: _s, utcEnd: _e, isOrigin: _o, calendarIds, created: _c, updated: _up, sequence: _sq, recurrenceId: _ri, recurrenceIdTimeZone: _rt, ...rest } = ev as CalendarEvent & Record<string, unknown>;
|
||||
@@ -123,16 +123,16 @@ export function CalendarContextMenu({ ctx, onClose, onOpen, onEdit, onCreate }:
|
||||
<MenuItem icon={<X size={16} />} label={t("No category")} disabled={!currentCat} onClick={() => { onClose(); setCategory(null); }} />
|
||||
<MenuItem icon={<Tag size={16} />} label={t("Manage categories…")} onClick={() => { onClose(); navigate("/settings/calendar"); }} />
|
||||
{/*
|
||||
A colour is what a category already carries, so a second way to set
|
||||
A color is what a category already carries, so a second way to set
|
||||
one just made two things that could disagree. Picking a category is
|
||||
now the only way to colour an event here.
|
||||
now the only way to color an event here.
|
||||
|
||||
Clearing one stays, though, and only when there is one to clear: an
|
||||
event that already has an explicit colour — set before this, or by
|
||||
event that already has an explicit color — set before this, or by
|
||||
another client — would otherwise ignore its category for ever with
|
||||
nothing on the menu to say why.
|
||||
*/}
|
||||
{ev.color && <MenuItem icon={<Palette size={16} />} label={t("Clear custom colour")} onClick={() => { onClose(); setColor(null); }} />}
|
||||
{ev.color && <MenuItem icon={<Palette size={16} />} label={t("Clear custom color")} onClick={() => { onClose(); setColor(null); }} />}
|
||||
<MenuSep />
|
||||
<MenuItem danger icon={<Trash2 size={16} />} label={t("Delete")} onClick={() => void del()} />
|
||||
</>
|
||||
|
||||
@@ -26,7 +26,7 @@ type View = "month" | "week" | "day" | "agenda";
|
||||
* They used to be `v[0].toUpperCase() + v.slice(1)`, which is correct English
|
||||
* and untranslatable in every other language: the extractor cannot see a
|
||||
* string that is computed, so the four buttons stayed English even in a
|
||||
* catalogue that had all four words. Called rather than looked up, because a
|
||||
* catalog that had all four words. Called rather than looked up, because a
|
||||
* module-level object would capture the labels for whichever language loaded
|
||||
* first.
|
||||
*/
|
||||
|
||||
@@ -181,7 +181,7 @@ function EventForm({ init, base, scope, editing, onClose, settingsTz, defaultAle
|
||||
/*
|
||||
* Everyone the event concerns, you first. Scheduling around the other people
|
||||
* and not around yourself is how two things end up at the same time, and the
|
||||
* organiser's own calendar was the one row the panel never showed.
|
||||
* organizer's own calendar was the one row the panel never showed.
|
||||
*/
|
||||
const people = useMemo(() => {
|
||||
const seen = new Set<string>();
|
||||
@@ -212,7 +212,7 @@ function EventForm({ init, base, scope, editing, onClose, settingsTz, defaultAle
|
||||
if (!contacts.principalsLoaded) void contacts.loadPrincipals();
|
||||
return;
|
||||
}
|
||||
let cancelled = false;
|
||||
let canceled = false;
|
||||
(async () => {
|
||||
const out: Record<string, BusyPeriod[] | null> = {};
|
||||
for (const person of people) {
|
||||
@@ -235,10 +235,10 @@ function EventForm({ init, base, scope, editing, onClose, settingsTz, defaultAle
|
||||
out[person.email] = null;
|
||||
}
|
||||
}
|
||||
if (!cancelled) setFb(out);
|
||||
if (!canceled) setFb(out);
|
||||
})();
|
||||
return () => {
|
||||
cancelled = true;
|
||||
canceled = true;
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [people.map((p) => p.email).join(","), fbWindow.start.getTime(), fbWindow.end.getTime(), contacts.principalsLoaded, selfPrincipalId]);
|
||||
@@ -538,7 +538,7 @@ function EventForm({ init, base, scope, editing, onClose, settingsTz, defaultAle
|
||||
{showMore && (
|
||||
<div className="mt-8">
|
||||
<div className="field-row">
|
||||
<div className="field"><label>{translate("Status")}</label><select className="select" value={status} onChange={(e) => setStatus(e.target.value as typeof status)}><option value="confirmed">{translate("Confirmed")}</option><option value="tentative">{translate("Tentative")}</option><option value="cancelled">{translate("Cancelled")}</option></select></div>
|
||||
<div className="field"><label>{translate("Status")}</label><select className="select" value={status} onChange={(e) => setStatus(e.target.value as typeof status)}><option value="confirmed">{translate("Confirmed")}</option><option value="tentative">{translate("Tentative")}</option><option value="cancelled">{translate("Canceled")}</option></select></div>
|
||||
<div className="field"><label>{translate("Show as")}</label><select className="select" value={freeBusy} onChange={(e) => setFreeBusy(e.target.value as typeof freeBusy)}><option value="busy">{translate("Busy")}</option><option value="free">{translate("Free")}</option></select></div>
|
||||
{!oneDate && <div className="field"><label>{translate("Visibility")}</label><select className="select" value={privacy} onChange={(e) => setPrivacy(e.target.value as typeof privacy)}><option value="public">{translate("Default")}</option><option value="private">{translate("Private")}</option><option value="secret">{translate("Secret")}</option></select></div>}
|
||||
</div>
|
||||
|
||||
@@ -80,7 +80,7 @@ export function EventPopover({ inst, anchor, onClose, onEdit }: { inst: EventIns
|
||||
{ev.description && <div className="ev-line"><AlignLeft size={15} /><span style={{ whiteSpace: "pre-wrap", maxHeight: 160, overflow: "auto" }}>{ev.description}</span></div>}
|
||||
{alerts.length > 0 && <div className="ev-line"><Bell size={15} /><span>{alerts.map((a) => ("offset" in a.trigger ? humanDuration(parseDuration(a.trigger.offset)) + (parseDuration(a.trigger.offset) < 0 ? " before" : " after") : "at " + a.trigger.when)).join(", ")}</span></div>}
|
||||
{category && <div className="ev-line"><span className="label-dot" style={{ background: category.color, width: 12, height: 12, marginTop: 3 }} /><span>{category.name}</span></div>}
|
||||
<div className="ev-line"><CalIcon size={15} /><span>{`${inst.calendar?.name ?? "Calendar"}${ev.status === "cancelled" ? " · cancelled" : ev.status === "tentative" ? " · tentative" : ""}${ev.privacy && ev.privacy !== "public" ? ` · ${ev.privacy}` : ""}${ev.freeBusyStatus === "free" ? " · shown as free" : ""}`}</span></div>
|
||||
<div className="ev-line"><CalIcon size={15} /><span>{`${inst.calendar?.name ?? "Calendar"}${ev.status === "cancelled" ? " · canceled" : ev.status === "tentative" ? " · tentative" : ""}${ev.privacy && ev.privacy !== "public" ? ` · ${ev.privacy}` : ""}${ev.freeBusyStatus === "free" ? " · shown as free" : ""}`}</span></div>
|
||||
{participants.length > 0 && (
|
||||
<div className="ev-line" style={{ flexDirection: "column", gap: 2 }}>
|
||||
<div className="row gap-8"><Users size={15} /><span>{`${participants.length} participant${participants.length === 1 ? "" : "s"}`}</span><button className="icon-btn xs" title={t("Email everyone")} onClick={() => openCompose({ to: participants.map(([, p]) => ({ name: p.name ?? null, email: participantEmail(p) })).filter((a) => a.email), subject: ev.title ?? "" })}><Mail size={13} /></button></div>
|
||||
|
||||
Reference in New Issue
Block a user