aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2017-10-05 05:21:07 +0300
committersiikamiika <siikamiika@users.noreply.github.com>2017-10-05 05:21:07 +0300
commitcfad3b309976213c45f99bef3b8fad072c6bb9ec (patch)
treee2e92586367c5be0bfaaebe179bd407cadb471ad /ext/bg/js/translator.js
parent03fd9dcdb451ad55b9b2d2b5bd489e6ca3ba648a (diff)
merged mode: add main dictionary selection
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 81253374..3442124f 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -49,10 +49,11 @@ class Translator {
}
async findTermsMerged(text, dictionaries, alphanumeric) {
+ const options = await apiOptionsGet();
const titles = Object.keys(dictionaries);
const {length, definitions} = await this.findTerms(text, dictionaries, alphanumeric);
- const definitionsBySequence = dictTermsMergeBySequence(definitions);
+ const definitionsBySequence = dictTermsMergeBySequence(definitions, options.dictionary.main);
const definitionsMerged = dictTermsGroup(definitionsBySequence['-1'], dictionaries);
for (const sequence in definitionsBySequence) {
@@ -62,7 +63,7 @@ class Translator {
const result = definitionsBySequence[sequence];
- const rawDefinitionsBySequence = await this.database.findTermsBySequence(Number(sequence));
+ const rawDefinitionsBySequence = await this.database.findTermsBySequence(Number(sequence), options.dictionary.main);
const definitionsByGloss = dictTermsMergeByGloss(result, rawDefinitionsBySequence);
// postprocess glossaries