From 20b6475f189fc315f232d6bab6ae77ce045a9b0a Mon Sep 17 00:00:00 2001 From: John Coffey Date: Thu, 3 Sep 2026 11:58:17 -0700 Subject: [PATCH] Second pass: four dialogs that were never wrapped A sweep for UI text still rendering in English, after the nine catalogues were brought up to date. Four dialogs were building their own English: - The delete confirmation in MailView, entirely: both titles, both messages and the confirm label. Its counts read "message(s)", which is a parenthesis standing in for agreement -- every language that inflects got the wrong form. They are plural() calls now. - Rename, in the Files tree. - New address book, and its Name placeholder. - New category, and its Name placeholder. The button opening that dialog was already translated, which is how it went unnoticed: the label read right and the dialog it opened did not. Rename, New address book, New category, Name and Delete are already in all nine catalogues. Delete?, Delete forever? and the two plural forms are new and land with each language. Verified: typecheck clean, 1000 tests pass. --- web/src/views/contacts/ContactsSidebar.tsx | 2 +- web/src/views/files/FilesTree.tsx | 2 +- web/src/views/mail/MailView.tsx | 11 ++++++++++- web/src/views/settings/CalendarSettings.tsx | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/web/src/views/contacts/ContactsSidebar.tsx b/web/src/views/contacts/ContactsSidebar.tsx index faa738e..3ef0591 100644 --- a/web/src/views/contacts/ContactsSidebar.tsx +++ b/web/src/views/contacts/ContactsSidebar.tsx @@ -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()); diff --git a/web/src/views/files/FilesTree.tsx b/web/src/views/files/FilesTree.tsx index b96fda6..9137a3d 100644 --- a/web/src/views/files/FilesTree.tsx +++ b/web/src/views/files/FilesTree.tsx @@ -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()); diff --git a/web/src/views/mail/MailView.tsx b/web/src/views/mail/MailView.tsx index e34e090..3e4e896 100644 --- a/web/src/views/mail/MailView.tsx +++ b/web/src/views/mail/MailView.tsx @@ -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); diff --git a/web/src/views/settings/CalendarSettings.tsx b/web/src/views/settings/CalendarSettings.tsx index 6d073dd..78af5f8 100644 --- a/web/src/views/settings/CalendarSettings.tsx +++ b/web/src/views/settings/CalendarSettings.tsx @@ -60,7 +60,7 @@ export function CalendarSettings() {
update({ eventCategories: s.eventCategories.map((x, j) => (j === i ? { ...x, color: col } : x)) })} />
))} - +

{t("Subscribed calendars")}