Merge pull request #258 from Coffey-Labs/i18n-second-pass
Second pass: four dialogs that were never wrapped
This commit is contained in:
@@ -114,7 +114,7 @@ export function ContactsSidebar() {
|
||||
title={t("New address book")}
|
||||
aria-label={t("New address book")}
|
||||
onClick={async () => {
|
||||
const name = await promptDialog({ title: "New address book", placeholder: "Name" });
|
||||
const name = await promptDialog({ title: t("New address book"), placeholder: t("Name") });
|
||||
if (!name?.trim()) return;
|
||||
try {
|
||||
await contacts.createBook(name.trim());
|
||||
|
||||
@@ -257,7 +257,7 @@ export function FilesTree() {
|
||||
label={t("Rename")}
|
||||
disabled={!menuNode.myRights?.mayRename}
|
||||
onClick={async () => {
|
||||
const name = await promptDialog({ title: "Rename", defaultValue: menuNode.name });
|
||||
const name = await promptDialog({ title: t("Rename"), defaultValue: menuNode.name });
|
||||
if (!name?.trim() || name === menuNode.name) return;
|
||||
try {
|
||||
await useFiles.getState().rename(menuNode.id, name.trim());
|
||||
|
||||
@@ -228,7 +228,16 @@ export function MailView({ mailboxId, threadId, search }: { mailboxId?: string;
|
||||
const trashId = mail.roleId("trash");
|
||||
const permanent = t.every((id) => trashId && mail.emails[id]?.mailboxIds[trashId]);
|
||||
if (permanent || settings.confirmDelete) {
|
||||
const ok = await confirmDialog({ title: permanent ? "Delete forever?" : "Delete?", message: permanent ? `${t.length} message(s) will be permanently deleted.` : `Move ${t.length} message(s) to Trash?`, confirmLabel: "Delete", danger: permanent });
|
||||
// "message(s)" was doing the work a plural form should: every
|
||||
// language that inflects got a parenthesis instead of agreement.
|
||||
const ok = await confirmDialog({
|
||||
title: permanent ? translate("Delete forever?") : translate("Delete?"),
|
||||
message: permanent
|
||||
? plural(t.length, { one: "{n} message will be permanently deleted.", other: "{n} messages will be permanently deleted." })
|
||||
: plural(t.length, { one: "Move {n} message to Trash?", other: "Move {n} messages to Trash?" }),
|
||||
confirmLabel: translate("Delete"),
|
||||
danger: permanent,
|
||||
});
|
||||
if (!ok) return;
|
||||
}
|
||||
await mail.trash(t);
|
||||
|
||||
@@ -60,7 +60,7 @@ export function CalendarSettings() {
|
||||
<div style={{ marginTop: 8 }}><ColorSwatches value={c.color} onChange={(col) => update({ eventCategories: s.eventCategories.map((x, j) => (j === i ? { ...x, color: col } : x)) })} /></div>
|
||||
</div>
|
||||
))}
|
||||
<button className="btn mb-16" onClick={async () => { const n = await promptDialog({ title: "New category", placeholder: "Name" }); if (n?.trim() && !s.eventCategories.some((c) => c.name.toLowerCase() === n.trim().toLowerCase())) update({ eventCategories: [...s.eventCategories, { name: n.trim(), color: CALENDAR_COLORS[s.eventCategories.length % CALENDAR_COLORS.length]! }] }); }}><Plus size={16} /> {t("New category")}</button>
|
||||
<button className="btn mb-16" onClick={async () => { const n = await promptDialog({ title: t("New category"), placeholder: t("Name") }); if (n?.trim() && !s.eventCategories.some((c) => c.name.toLowerCase() === n.trim().toLowerCase())) update({ eventCategories: [...s.eventCategories, { name: n.trim(), color: CALENDAR_COLORS[s.eventCategories.length % CALENDAR_COLORS.length]! }] }); }}><Plus size={16} /> {t("New category")}</button>
|
||||
|
||||
<h2>{t("Subscribed calendars")}</h2>
|
||||
<p className="hint" style={{ marginTop: -8 }}>
|
||||
|
||||
Reference in New Issue
Block a user