From 3ec57d5bf658c247835fc933c2c41ea4e5ea52f6 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 10 Sep 2016 22:25:16 -0700 Subject: Fixes --- ext/bg/js/translator.js | 10 ++++++++-- ext/bg/js/yomichan.js | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'ext') diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js index ccf1876f..6c028c5c 100644 --- a/ext/bg/js/translator.js +++ b/ext/bg/js/translator.js @@ -59,12 +59,18 @@ class Translator { const promises = []; for (let i = text.length; i > 0; --i) { - promises.append( + promises.push( this.deinflector.deinflect(text.slice(0, i), term => { return this.dictionary.findTerm(term).then(definitions => definitions.map(def => def.tags)); }).then(inflects => { for (const inflect of inflects) { - this.processTerm(groups, df.source, df.tags, df.rules, df.root); + this.processTerm( + groups, + inflect.source, + inflect.tags, + inflect.rules, + inflect.root + ); } }) ); diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js index 716c622a..557f8780 100644 --- a/ext/bg/js/yomichan.js +++ b/ext/bg/js/yomichan.js @@ -297,7 +297,7 @@ class Yomichan { } api_findTerm({text, callback}) { - callback(this.translator.findTerm(text)); + this.translator.findTerm(text).then((result) => callback(result)); } api_getDeckNames({callback}) { -- cgit v1.2.3