From da3e05fb6f4f4697ad5bf1b9ec8870dadf75ad27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Wed, 3 Jun 2026 09:50:51 +0300 Subject: [PATCH] Adjust message --- chrome/content/zotero/xpcom/integration.js | 5 ++++- chrome/locale/en-US/zotero/zotero.properties | 2 +- test/tests/integrationTest.js | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index e86f5ccd9e..ab5235c61d 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -1517,7 +1517,10 @@ Zotero.Integration.Session.prototype.cite = async function (field, addNote=false citation = new Zotero.Integration.Citation(field, await field.unserialize(), await field.getNoteIndex()); } else if (field.type === INTEGRATION_TYPE_BIBLIOGRAPHY) { - throw new Zotero.Exception.Alert("integration.error.inBibliography"); + let commandName = this._app.processorName == 'Google Docs' + ? '“Add/edit bibliography”' + : 'Add/Edit Bibliography'; + throw new Zotero.Exception.Alert("integration.error.inBibliography", [commandName]); } else { // Treat any non-item and non-bibliograph field as a TEMP placeholder, that is likely diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index 1325699b3b..81dff45f67 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -894,7 +894,7 @@ integration.error.mustInsertCitation = You must insert a citation before perfor integration.error.mustInsertBibliography = You must insert a bibliography before performing this operation. integration.error.cannotInsertHere = Zotero fields cannot be inserted here. integration.error.notInCitation = You must place the cursor in a Zotero citation to edit it. -integration.error.inBibliography = To insert a citation, place the cursor in the body of the text. To edit the bibliography directly, use the Add/Edit Bibliography button. +integration.error.inBibliography = To insert a citation, place the cursor in the body of the text. To edit the bibliography directly, use %S. integration.error.noBibliography = The current bibliographic style does not define a bibliography. If you wish to add a bibliography, please choose another style. integration.error.deletePipe = The pipe that Zotero uses to communicate with the word processor could not be initialized. Would you like Zotero to attempt to correct this error? You will be prompted for your password. integration.error.invalidStyle = The style you have selected does not appear to be valid. If you have created this style yourself, please ensure that it passes validation as described at https://github.com/citation-style-language/styles/wiki/Validation. Alternatively, try selecting another style. diff --git a/test/tests/integrationTest.js b/test/tests/integrationTest.js index 186dbb46da..3427d95ca2 100644 --- a/test/tests/integrationTest.js +++ b/test/tests/integrationTest.js @@ -646,7 +646,10 @@ describe("Zotero.Integration", function () { await execCommand('addEditCitation', docID); assert.isTrue(displayAlertStub.calledOnce); - assert.equal(displayAlertStub.firstCall.args[0], Zotero.getString('integration.error.inBibliography')); + assert.equal( + displayAlertStub.firstCall.args[0], + Zotero.getString('integration.error.inBibliography', ['Add/Edit Bibliography']) + ); }); it('should write an implicitly updated citation into the document', async function () {