From 99b80723b806f702f8ddd331e0c66d84151b9699 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 2 Dec 2024 22:39:34 -0500 Subject: [PATCH] Move special handling of 'timestamp' locator Avoid "Locator 'timestamp' is empty in en-US locale" warning when opening citation dialog after 969feb620d --- chrome/content/zotero/xpcom/cite.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/xpcom/cite.js b/chrome/content/zotero/xpcom/cite.js index cfeaa4bc65..bfa0004e6b 100644 --- a/chrome/content/zotero/xpcom/cite.js +++ b/chrome/content/zotero/xpcom/cite.js @@ -48,11 +48,6 @@ Zotero.Cite = { * @return {String} - Localized string (e.g., 'Livre') */ getLocatorString: function (locator, form = null) { - // 'timestamp' not included in CSL locales - if (locator == 'timestamp') { - return Zotero.getString('citation.locator.timestamp'); - } - // Get the best CSL locale for the current Zotero locale var cslLocale = Zotero.Utilities.Internal.resolveLocale( Zotero.locale, @@ -84,6 +79,12 @@ Zotero.Cite = { var englishDoc; // Cache all locators for the current locale for (let locator of this.labels) { + // 'timestamp' not included in CSL locales + if (locator == 'timestamp') { + map.set(locator, Zotero.getString('citation.locator.timestamp')); + continue; + } + // Fetch all s - including the short form let terms = [...doc.querySelectorAll(`term[name="${locator}"]`)]; if (!terms.length) {