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.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;