mirror of
https://github.com/zotero/zotero.git
synced 2026-10-07 02:58:09 +00:00
this.translator may contain Zotero.Translate objects or translatorID's
This commit is contained in:
parent
f3bae4b000
commit
e412580598
1 changed files with 8 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue