Fix export translation

Restore Zotero.Promise.method() wrapper on getCodeForTranslator()
because the translation framework needs it to return a synchronously
resolved promise, unfortunately.
This commit is contained in:
Abe Jellinek 2025-07-17 11:13:45 -04:00 • committed by Dan Stillman
parent 04e03478a9
commit 1dd60c948b

View file

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