From 2b87c919bcd879c7f356308bc522b95f33e35f3b Mon Sep 17 00:00:00 2001 From: StefanVukovic99 Date: Sat, 20 Jan 2024 02:25:23 +0100 Subject: Dictionary deinflections (#503) * wip * wip * fix v3 * wip * fix tests * fix maxitems * hide deinflection definitions * fix anki template * undo unnecessary change * delete console.log * refactor * add set false to handlebars * lint * fix tests * fix comments * fix * use Map in areArraysEqualIgnoreOrder * move inflection source icons to css * lint * improve naming * fix tests * add test * typescript * use for of * wip * comments * anki template upgrade * update descriptions --- ext/js/data/options-util.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'ext/js/data/options-util.js') diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js index c93e261d..0aabed6f 100644 --- a/ext/js/data/options-util.js +++ b/ext/js/data/options-util.js @@ -556,7 +556,8 @@ export class OptionsUtil { this._updateVersion20, this._updateVersion21, this._updateVersion22, - this._updateVersion23 + this._updateVersion23, + this._updateVersion24 ]; if (typeof targetVersion === 'number' && targetVersion < result.length) { result.splice(targetVersion); @@ -1155,6 +1156,20 @@ export class OptionsUtil { } } + /** + * - Added dictionaries[].useDeinflections. + * @type {import('options-util').UpdateFunction} + */ + async _updateVersion24(options) { + await this._applyAnkiFieldTemplatesPatch(options, '/data/templates/anki-field-templates-upgrade-v24.handlebars'); + + for (const {options: profileOptions} of options.profiles) { + for (const dictionary of profileOptions.dictionaries) { + dictionary.useDeinflections = true; + } + } + } + /** * @param {string} url * @returns {Promise} -- cgit v1.2.3