From c338c0262d38fef7ac803f7a2f0df0f1519c5293 Mon Sep 17 00:00:00 2001 From: abaevbog Date: Sat, 19 Oct 2024 23:05:22 -0700 Subject: [PATCH] =?UTF-8?q?Better=20label=20to=20make=20item=20standalone?= =?UTF-8?q?=20in=20"Change=20Parent=20Item=E2=80=A6"=20dialog=20(#4768)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit More specific labels for the button to turn selected item(s) into standalone: - "Convert to Standalone Sttachment(s)" when only attachments are selected - "Convert to Standalone Note(s)" when only notes are selected - "Convert to Standalone" otherwise (e.g. if a note and an attachment are selected together) Fixes: #4766 --- chrome/content/zotero/zoteroPane.js | 8 ++++++-- chrome/locale/en-US/zotero/zotero.ftl | 7 +++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index d506c268af..d5dd3f9bb9 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -5156,11 +5156,15 @@ var ZoteroPane = new function() let extraButtons = []; // Keep in sync with Zotero.RecognizeDocument.canRecognize() let canBeMovedOutOfParent = !selectedItems.some(item => item.isWebAttachment() && !item.isPDFAttachment() && !item.isEPUBAttachment()); - // Add a button to the dialog to make attachments standalone, if applicable + // Add a button to the dialog to make items standalone, if applicable if (canBeMovedOutOfParent) { + // Determine which label to show. "Convert to standalone attachment(s)/note(s)" + let allNotes = selectedItems.every(item => item.isNote()); + let allAttachments = selectedItems.every(item => item.isAttachment()); + let l10nId = `select-items-convertToStandalone${allNotes ? "Note" : ""}${allAttachments ? "Attachment" : ""}`; extraButtons = [{ type: "extra1", - l10nLabel: "select-items-convertToStandaloneAttachment", + l10nLabel: l10nId, l10nArgs: { count: selectedItems.length }, onclick: function (event) { shouldConvertToStandaloneAttachment = true; diff --git a/chrome/locale/en-US/zotero/zotero.ftl b/chrome/locale/en-US/zotero/zotero.ftl index 6173d428c7..711c135aa6 100644 --- a/chrome/locale/en-US/zotero/zotero.ftl +++ b/chrome/locale/en-US/zotero/zotero.ftl @@ -692,11 +692,18 @@ find-pdf-files-added = { $count -> select-items-dialog = .buttonlabelaccept = Select +select-items-convertToStandalone = + .label = Convert to Standalone select-items-convertToStandaloneAttachment = .label = { $count -> [one] Convert to Standalone Attachment *[other] Convert to Standalone Attachments } +select-items-convertToStandaloneNote = + .label = { $count -> + [one] Convert to Standalone Note + *[other] Convert to Standalone Notes +} file-type-webpage = Webpage file-type-image = Image