diff options
Diffstat (limited to 'ext/js/language')
-rw-r--r-- | ext/js/language/translator.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/js/language/translator.js b/ext/js/language/translator.js index 31fc6d81..350cbc57 100644 --- a/ext/js/language/translator.js +++ b/ext/js/language/translator.js @@ -1932,6 +1932,10 @@ export class Translator { i = v2.dictionaryPriority - v1.dictionaryPriority; if (i !== 0) { return i; } + // Sort by dictionary order + i = v1.dictionaryIndex - v2.dictionaryIndex; + if (i !== 0) { return i; } + // Sort by term score i = v2.score - v1.score; if (i !== 0) { return i; } @@ -1952,10 +1956,6 @@ export class Translator { // Sort by definition count i = v2.definitions.length - v1.definitions.length; - if (i !== 0) { return i; } - - // Sort by dictionary order - i = v1.dictionaryIndex - v2.dictionaryIndex; return i; }; dictionaryEntries.sort(compareFunction); @@ -1979,6 +1979,10 @@ export class Translator { i = v2.dictionaryPriority - v1.dictionaryPriority; if (i !== 0) { return i; } + // Sort by dictionary order + i = v1.dictionaryIndex - v2.dictionaryIndex; + if (i !== 0) { return i; } + // Sort by term score i = v2.score - v1.score; if (i !== 0) { return i; } @@ -1994,10 +1998,6 @@ export class Translator { if (i !== 0) { return i; } } - // Sort by dictionary order - i = v1.dictionaryIndex - v2.dictionaryIndex; - if (i !== 0) { return i; } - // Sort by original order i = v1.index - v2.index; return i; |