www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit e4125805983da8178aeeaad693c846780051f023
parent f3bae4b00052a3cbf946ed2a9525e75c6e4ebb52
Author: aurimasv <aurimas.dev@gmail.com>
Date:   Sun,  8 Apr 2012 23:48:10 -0500

this.translator may contain Zotero.Translate objects or translatorID's

Diffstat:
Mchrome/content/zotero/xpcom/translation/translate.js | 12++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js @@ -909,10 +909,14 @@ Zotero.Translate.Base.prototype = { var translators = new Array(); var t; for(var i=0, n=this.translator.length; i<n; i++) { - t = Zotero.Translators.get(this.translator[i]); - if(!t) Zotero.debug("getTranslators: could not retrieve translator '" + this.translator[i] + "'"); - /**TODO: check that the translator is of appropriate type*/ - else translators.push(t); + if(typeof(this.translator[i]) == 'string') { + t = Zotero.Translators.get(this.translator[i]); + if(!t) Zotero.debug("getTranslators: could not retrieve translator '" + this.translator[i] + "'"); + } else { + t = this.translator[i]; + } + /**TODO: check that the translator is of appropriate type?*/ + if(t) translators.push(t); } if(!translators.length) throw new Error("getTranslators: no valid translators were set."); this._getTranslatorsTranslatorsReceived(translators);