aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-08-21 19:51:12 -0700
committerAlex Yatskov <alex@foosoft.net>2016-08-21 19:51:12 -0700
commita062b25178dd8d916a8cdf87cffa36b5365ab021 (patch)
treef86cf6bfd68aee3814a1e9519839204d00311bc7 /ext/bg/js/translator.js
parent67f906ab24acb80a8ffbad29ff8ddda5fc570cf0 (diff)
Work on DB integration
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r--ext/bg/js/translator.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index f373fe83..9fd1ab59 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -41,15 +41,16 @@ class Translator {
this.loaded = true;
callback();
}).catch(() => {
+ this.dictionary.initDb();
return Translator.loadData('bg/data/edict.json');
}).then((response) => {
- this.dictionary.importTermDict('edict', JSON.parse(response));
+ this.dictionary.importTermDict(JSON.parse(response));
return Translator.loadData('bg/data/enamdict.json');
}).then((response) => {
- this.dictionary.importTermDict('enamdict', JSON.parse(response));
+ this.dictionary.importTermDict(JSON.parse(response));
return Translator.loadData('bg/data/kanjidic.json');
}).then((response) => {
- this.dictionary.importKanjiDict('kanjidic', JSON.parse(response));
+ this.dictionary.importKanjiDict(JSON.parse(response));
this.loaded = true;
callback();
});