From 1dd60c948b882a1a74db4da2268ec3e70e462c07 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Thu, 17 Jul 2025 11:13:45 -0400 Subject: [PATCH] Fix export translation Restore Zotero.Promise.method() wrapper on getCodeForTranslator() because the translation framework needs it to return a synchronously resolved promise, unfortunately. --- chrome/content/zotero/xpcom/translation/translators.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/translation/translators.js b/chrome/content/zotero/xpcom/translation/translators.js index d437c0fc6e..1d67c91ee5 100644 --- a/chrome/content/zotero/xpcom/translation/translators.js +++ b/chrome/content/zotero/xpcom/translation/translators.js @@ -363,7 +363,7 @@ Zotero.Translators = new function () { return _translators[id] ? _translators[id] : false; } - this.getCodeForTranslator = function (translator) { + this.getCodeForTranslator = Zotero.Promise.method(function (translator) { if (translator.code) return translator.code; return Zotero.File.getContentsAsync(translator.path).then(function (code) { if (translator.cacheCode) { @@ -372,7 +372,7 @@ Zotero.Translators = new function () { } return code; }); - }; + }); /** * Gets all translators for a specific type of translation