aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-04-12 20:58:41 -0700
committerAlex Yatskov <alex@foosoft.net>2016-04-12 20:58:41 -0700
commitbf28dea2838619c6446367f240e240cdddef3586 (patch)
treeb30b9c6b2a8c70092df395492c44300c4d8c6a63 /ext/bg/js/translator.js
parent7d0991f9c1b1379c669c0da9f1f678285dd0c968 (diff)
Updating dictionaries
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r--ext/bg/js/translator.js15
1 files changed, 2 insertions, 13 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index e8224320..5414a553 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -46,11 +46,11 @@ class Translator {
this.deinflector.setRules(JSON.parse(response));
break;
case 'kanjidic':
- this.dictionary.addKanjiData(Translator.parseCsv(response));
+ this.dictionary.addKanjiDict('kanjidic', JSON.parse(response));
break;
case 'edict':
case 'enamdict':
- this.dictionary.addTermData(Translator.parseCsv(response));
+ this.dictionary.addTermDict(key, JSON.parse(response));
break;
}
@@ -164,15 +164,4 @@ class Translator {
xhr.open('GET', chrome.extension.getURL(url), true);
xhr.send();
}
-
- static parseCsv(data) {
- const result = [];
- for (const row of data.split('\n')) {
- if (row.length > 0) {
- result.push(row.split('\t'));
- }
- }
-
- return result;
- }
}