Skip to content

Commit

Permalink
Fix alias not working correctly for grouped entries
Browse files Browse the repository at this point in the history
  • Loading branch information
khaitruong922 committed Jul 26, 2024
1 parent 49c266b commit 914472d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ext/js/display/display-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ export class DisplayGenerator {
const dictionaryTag = this._createDictionaryTag('');
for (let i = 0, ii = definitions.length; i < ii; ++i) {
const definition = definitions[i];
const {dictionary} = definition;
const {dictionary, dictionaryAlias} = definition;

if (dictionaryTag.dictionaries.includes(dictionary)) {
dictionaryTag.redundant = true;
} else {
dictionaryTag.redundant = false;
dictionaryTag.dictionaries.push(dictionary);
dictionaryTag.name = dictionaryEntry.dictionaryAlias;
dictionaryTag.name = dictionaryAlias;
dictionaryTag.content = [dictionary];
}

Expand Down
2 changes: 1 addition & 1 deletion ext/js/language/translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,7 @@ export class Translator {
let score = Number.MIN_SAFE_INTEGER;
let dictionaryIndex = Number.MAX_SAFE_INTEGER;
let dictionaryPriority = Number.MIN_SAFE_INTEGER;
const dictionaryAlias = dictionaryEntries[0]?.dictionaryAlias; // wrong
const dictionaryAlias = "";

Check failure on line 1780 in ext/js/language/translator.js

View workflow job for this annotation

GitHub Actions / Static Analysis

Strings must use singlequote
let maxOriginalTextLength = 0;
let isPrimary = false;
/** @type {import('dictionary').TermDefinition[]} */
Expand Down

0 comments on commit 914472d

Please sign in to comment.