From c4dbf194460d2462599ce78ac60c991920517870 Mon Sep 17 00:00:00 2001 From: abaevbog Date: Thu, 30 May 2024 01:44:49 -0400 Subject: [PATCH] vpat 23: better aria label for itembox merge btn (#4173) Added the field name for the label to be more descriptive. The new announced label is e.g. "Select version of title field". Followup to https://github.com/zotero/zotero/pull/4096#issuecomment-2121894422 --- chrome/content/zotero/elements/itemBox.js | 3 ++- chrome/locale/en-US/zotero/zotero.ftl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/elements/itemBox.js b/chrome/content/zotero/elements/itemBox.js index a313241799..1c458a2ec5 100644 --- a/chrome/content/zotero/elements/itemBox.js +++ b/chrome/content/zotero/elements/itemBox.js @@ -674,7 +674,8 @@ var button = document.createXULElement("toolbarbutton"); button.className = 'zotero-field-version-button zotero-clicky-merge'; button.setAttribute('type', 'menu'); - button.setAttribute('data-l10n-id', 'itembox-button-merge'); + let fieldLocalName = rowLabel.querySelector("label")?.textContent; + document.l10n.setAttributes(button, 'itembox-button-merge', { field: fieldLocalName || "" }); var popup = button.appendChild(document.createXULElement("menupopup")); diff --git a/chrome/locale/en-US/zotero/zotero.ftl b/chrome/locale/en-US/zotero/zotero.ftl index 4d36e817ce..19d1dc6096 100644 --- a/chrome/locale/en-US/zotero/zotero.ftl +++ b/chrome/locale/en-US/zotero/zotero.ftl @@ -122,7 +122,7 @@ item-button-view-online = itembox-button-options = .tooltiptext = Open Context Menu itembox-button-merge = - .aria-label = Select Version + .aria-label = Select version of { $field } field reader-use-dark-mode-for-content = .label = Use Dark Mode for Content