summaryrefslogtreecommitdiff
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, 2 insertions, 3 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index 5fcdea76..e6790fbf 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -57,12 +57,11 @@ class Translator {
async findTermsMerged(text, dictionaries, alphanumeric) {
const options = await apiOptionsGet();
- const mainDictionary = Object.keys(options.dictionaries).filter(dict => options.dictionaries[dict].main).concat([''])[0];
const secondarySearchTitles = Object.keys(options.dictionaries).filter(dict => options.dictionaries[dict].allowSecondarySearches);
const titles = Object.keys(dictionaries);
const {length, definitions} = await this.findTerms(text, dictionaries, alphanumeric);
- const definitionsBySequence = dictTermsMergeBySequence(definitions, mainDictionary);
+ const definitionsBySequence = dictTermsMergeBySequence(definitions, options.general.mainDictionary);
const definitionsMerged = [];
const mergedByTermIndices = new Set();
@@ -73,7 +72,7 @@ class Translator {
const result = definitionsBySequence[sequence];
- const rawDefinitionsBySequence = await this.database.findTermsBySequence(Number(sequence), mainDictionary);
+ const rawDefinitionsBySequence = await this.database.findTermsBySequence(Number(sequence), options.general.mainDictionary);
const definitionsByGloss = dictTermsMergeByGloss(result, rawDefinitionsBySequence);
const secondarySearchResults = [];