aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r--ext/bg/js/translator.js18
1 files changed, 2 insertions, 16 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index 8af0e31b..30045378 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -31,9 +31,9 @@ class Translator {
return;
}
- Translator.loadJson('bg/data/rules.json').then((rules) => {
+ loadJson('bg/data/rules.json').then((rules) => {
this.deinflector.setRules(rules);
- return Translator.loadJson('bg/data/tags.json');
+ return loadJson('bg/data/tags.json');
}).then((tagMeta) => {
this.tagMeta = tagMeta;
return this.dictionary.existsDb();
@@ -240,18 +240,4 @@ class Translator {
return 0;
});
}
-
- static isKanji(c) {
- const code = c.charCodeAt(0);
- return code >= 0x4e00 && code < 0x9fb0 || code >= 0x3400 && code < 0x4dc0;
- }
-
- static loadJson(url) {
- return new Promise((resolve, reject) => {
- const xhr = new XMLHttpRequest();
- xhr.addEventListener('load', () => resolve(JSON.parse(xhr.responseText)));
- xhr.open('GET', chrome.extension.getURL(url), true);
- xhr.send();
- });
- }
}