Fix incorrect variables
This commit is contained in:
parent
74c679e6d2
commit
93411a3dac
|
@ -74,7 +74,7 @@ Zotero.Translators = new function() {
|
||||||
filesInCache[leafName] = true;
|
filesInCache[leafName] = true;
|
||||||
} else {
|
} else {
|
||||||
// otherwise, load from file
|
// otherwise, load from file
|
||||||
var translator = yield Zotero.Translators.loadFromFile(file);
|
var translator = yield Zotero.Translators.loadFromDisk(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(translator.translatorID) {
|
if(translator.translatorID) {
|
||||||
|
@ -152,7 +152,7 @@ Zotero.Translators = new function() {
|
||||||
*/
|
*/
|
||||||
this.loadFromDisk = function(file) {
|
this.loadFromDisk = function(file) {
|
||||||
const infoRe = /^\s*{[\S\s]*?}\s*?[\r\n]/;
|
const infoRe = /^\s*{[\S\s]*?}\s*?[\r\n]/;
|
||||||
return Zotero.File.getContentsAsync(this.file).then(function(source) {
|
return Zotero.File.getContentsAsync(file).then(function(source) {
|
||||||
return Zotero.Translators.load(file, infoRe.exec(source)[0], source);
|
return Zotero.Translators.load(file, infoRe.exec(source)[0], source);
|
||||||
}).fail(function() {
|
}).fail(function() {
|
||||||
throw "Invalid or missing translator metadata JSON object in " + file.leafName;
|
throw "Invalid or missing translator metadata JSON object in " + file.leafName;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user