From f3bae4b00052a3cbf946ed2a9525e75c6e4ebb52 Mon Sep 17 00:00:00 2001 From: aurimasv Date: Fri, 6 Apr 2012 20:31:28 -0500 Subject: [PATCH] Allow running detect with multiple translators set. --- .../content/zotero/xpcom/translation/translate.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index ffd0fc1c8b..c91bc7d3a2 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -898,6 +898,7 @@ Zotero.Translate.Base.prototype = { // do not allow simultaneous instances of getTranslators if(this._currentState === "detect") throw new Error("getTranslators: detection is already running"); this._currentState = "detect"; + this._getAllTranslators = getAllTranslators; if(checkSetTranslator) { // setTranslator must be called beforehand if checkSetTranslator is set @@ -905,11 +906,17 @@ Zotero.Translate.Base.prototype = { throw new Error("getTranslators: translator must be set via setTranslator before calling" + " getTranslators with the checkSetTranslator flag"); } - var translator = Zotero.Translators.get(this.translator[0]); - if(!translator) throw new Error("getTranslators: could not retrieve translator '" + this.translator[0] + "'"); - this._getTranslatorsTranslatorsReceived([translator]); + var translators = new Array(); + var t; + for(var i=0, n=this.translator.length; i