Better label to make item standalone in "Change Parent Item…" dialog (#4768)

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
This commit is contained in:
abaevbog 2024-10-19 23:05:22 -07:00 committed by GitHub
parent eea1291314
commit c338c0262d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 2 deletions

View file

@ -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;

View file

@ -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