Skip to content

Commit

Permalink
use for of
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanVukovic99 committed Jan 13, 2024
1 parent 778c4bf commit 9d1ed7d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ext/js/language/translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,13 @@ export class Translator {
async _getDictionaryDeinflections(deinflections, enabledDictionaryMap, matchType) {
/** @type {import('translation-internal').DatabaseDeinflection[]} */
const dictionaryDeinflections = [];
deinflections.forEach((deinflection) => {
for (const deinflection of deinflections) {
const {originalText, transformedText, inflectionPossibilities: algPossibilities, databaseEntries} = deinflection;
databaseEntries.forEach((entry) => {
for (const entry of databaseEntries) {
const {dictionary, definitions} = entry;
const entryDictionary = enabledDictionaryMap.get(dictionary);
const useDeinflections = entryDictionary?.useDeinflections ?? true;
if (!useDeinflections) { return; }
if (!useDeinflections) { continue; }
for (const definition of definitions) {
if (Array.isArray(definition)) {
const [formOf, inflections] = definition;
Expand All @@ -356,8 +356,8 @@ export class Translator {
dictionaryDeinflections.push(dictionaryDeinflection);
}
}
});
});
}
}

await this._addEntriesToDeinflections(dictionaryDeinflections, enabledDictionaryMap, matchType);

Expand Down

0 comments on commit 9d1ed7d

Please sign in to comment.