summaryrefslogtreecommitdiff
path: root/ext/jp/translator.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/jp/translator.js')
-rw-r--r--ext/jp/translator.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/jp/translator.js b/ext/jp/translator.js
index aef20f19..7a610377 100644
--- a/ext/jp/translator.js
+++ b/ext/jp/translator.js
@@ -18,9 +18,17 @@
class Translator {
- constructor(paths, callback) {
+ constructor() {
this.dictionary = new Dictionary();
this.deinflector = new Deinflector();
+ this.initialized = false;
+ }
+
+ loadData(paths, callback) {
+ if (this.initialized) {
+ callback();
+ return;
+ }
const loaders = [];
for (const key of ['rules', 'edict', 'enamdict', 'kanjidic']) {