summaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-09-20 23:15:02 -0700
committerAlex Yatskov <alex@foosoft.net>2017-09-20 23:15:02 -0700
commit119def2bebc9adea3a29e9152c7e4747d81d54fa (patch)
treee8ad278e336be09e34bbc6373da73496bb35c2a2 /ext/bg/js/translator.js
parent0554aa0d275dd989260ec8e426f35f946074c674 (diff)
wip
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r--ext/bg/js/translator.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index 7583d39a..454799a3 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -174,10 +174,11 @@ class Translator {
}
async expandStats(items, title) {
- const stats = [];
+ const stats = {};
for (const name in items) {
const base = name.split(':')[0];
const meta = await this.database.findTagForTitle(base, title);
+ const group = stats[meta.category] || [];
const stat = {name, value: items[name]};
for (const prop in meta || {}) {
@@ -186,7 +187,7 @@ class Translator {
}
}
- stats.push(dictTagSanitize(stat));
+ group.push(dictTagSanitize(stat));
}
return stats;