From f7a56efacf067a77348aa57dd5d12f1f3c94b435 Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Fri, 27 Sep 2024 22:00:54 +0200 Subject: [PATCH] Unify message in the item details pane when trash contains collections or searches (#4696) fix: #4688 --- chrome/content/zotero/elements/itemPane.js | 10 +++++++++- chrome/locale/en-US/zotero/zotero.ftl | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/elements/itemPane.js b/chrome/content/zotero/elements/itemPane.js index de0045d0ae..0dbc865b67 100644 --- a/chrome/content/zotero/elements/itemPane.js +++ b/chrome/content/zotero/elements/itemPane.js @@ -247,7 +247,15 @@ } else { let count = this.itemsView.rowCount; - msg = { l10nId: 'item-pane-message-unselected', l10nArgs: { count } }; + if (this.collectionTreeRow.isTrash() + && this.itemsView._rows?.some( + x => x.ref instanceof Zotero.Collection || x.ref instanceof Zotero.Search + )) { + msg = { l10nId: 'item-pane-message-objects-unselected', l10nArgs: { count } }; + } + else { + msg = { l10nId: 'item-pane-message-unselected', l10nArgs: { count } }; + } } this.setItemPaneMessage(msg); diff --git a/chrome/locale/en-US/zotero/zotero.ftl b/chrome/locale/en-US/zotero/zotero.ftl index 93dd19d122..dec32bcf3c 100644 --- a/chrome/locale/en-US/zotero/zotero.ftl +++ b/chrome/locale/en-US/zotero/zotero.ftl @@ -615,6 +615,12 @@ item-pane-message-unselected = { $count -> *[other] { $count } items in this view } +item-pane-message-objects-unselected = { $count -> + [0] No objects in this view + [one] { $count } object in this view + *[other] { $count } objects in this view +} + item-pane-duplicates-merge-items = .label = { $count -> [one] Merge { $count } item