summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-08-07 13:01:27 -0700
committerAlex Yatskov <alex@foosoft.net>2016-08-07 13:01:27 -0700
commit3c9f2c6a2e50617dbad4412f89fb37fb125bc3d0 (patch)
treee6bb3a4d303f8803f6fee33ba23b62ceb5d80669 /ext/bg
parentd3272efef7687d08d5c2a36b27328771db522f37 (diff)
Cleanup
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/deinflector.js6
-rw-r--r--ext/bg/js/translator.js16
2 files changed, 11 insertions, 11 deletions
diff --git a/ext/bg/js/deinflector.js b/ext/bg/js/deinflector.js
index 194dbab6..bbb228b5 100644
--- a/ext/bg/js/deinflector.js
+++ b/ext/bg/js/deinflector.js
@@ -20,9 +20,9 @@
class Deinflection {
constructor(term, tags=[], rule='') {
this.children = [];
- this.term = term;
- this.tags = tags;
- this.rule = rule;
+ this.term = term;
+ this.tags = tags;
+ this.rule = rule;
}
validate(validator) {
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index f2107b9f..b7fce392 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -27,9 +27,9 @@ class Translator {
kanjidic: 'bg/data/kanjidic.json'
};
- this.loaded = false;
- this.tags = null;
- this.dictionary = new Dictionary();
+ this.loaded = false;
+ this.tagMeta = null;
+ this.dictionary = new Dictionary();
this.deinflector = new Deinflector();
}
@@ -53,7 +53,7 @@ class Translator {
this.deinflector.setRules(JSON.parse(response));
break;
case 'tags':
- this.tags = JSON.parse(response);
+ this.tagMeta = JSON.parse(response);
break;
case 'kanjidic':
this.dictionary.addKanjiDict(key, JSON.parse(response));
@@ -165,7 +165,7 @@ class Translator {
}
}
- let popular = false;
+ let popular = false;
let tagItems = [];
for (let tag of entry.tags) {
const tagItem = {
@@ -175,10 +175,10 @@ class Translator {
name: tag
};
- const tagMeta = this.tags[tag];
+ const tagMeta = this.tagMeta[tag];
if (tagMeta) {
- for (const key in tagMeta) {
- tagItem[key] = tagMeta[key] || tagItem[key];
+ for (const tagProp in tagMeta) {
+ tagItem[tagProp] = tagMeta[tagProp] || tagItem[tagProp];
}
}