Return the promise in Zotero.Translators.loadFromDisk()
This commit is contained in:
parent
c1211b0357
commit
ccc18dd41e
1 changed files with 1 additions and 1 deletions
|
@ -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]/;
|
||||||
Zotero.File.getContentsAsync(this.file).then(function(source) {
|
return Zotero.File.getContentsAsync(this.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 a new issue