From 812567a09385adc2b8f5626b617b62fbb927542a Mon Sep 17 00:00:00 2001 From: kuuuube Date: Mon, 29 Jul 2024 13:20:09 -0400 Subject: [PATCH] Add pronunciation to recommended dictionary types --- ext/data/recommended-dictionaries.json | 3 ++- .../recommended-dictionaries-schema.json | 20 +++++++++++++++++++ .../settings/dictionary-import-controller.js | 1 + ext/welcome.html | 4 ++++ types/ext/dictionary-recommended.d.ts | 3 ++- 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/ext/data/recommended-dictionaries.json b/ext/data/recommended-dictionaries.json index ed0d99af20..d8c39f4fe9 100644 --- a/ext/data/recommended-dictionaries.json +++ b/ext/data/recommended-dictionaries.json @@ -9,6 +9,7 @@ "frequency": [ {"name": "BCCWJ-LUW", "url": "https://github.com/toasted-nutbread/yomichan-bccwj-frequency-dictionary/releases/download/1.0.1/BCCWJ-LUW.zip"} ], - "grammar": [] + "grammar": [], + "pronunciation": [] } } diff --git a/ext/data/schemas/recommended-dictionaries-schema.json b/ext/data/schemas/recommended-dictionaries-schema.json index 7f3de9972b..36d8f03fd9 100644 --- a/ext/data/schemas/recommended-dictionaries-schema.json +++ b/ext/data/schemas/recommended-dictionaries-schema.json @@ -86,6 +86,26 @@ } } } + }, + "pronunciation": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "url" + ], + "properties": { + "name": { + "type": "string", + "minLength": 2 + }, + "url": { + "type": "string", + "minLength": 2 + } + } + } } }, "required": [ diff --git a/ext/js/pages/settings/dictionary-import-controller.js b/ext/js/pages/settings/dictionary-import-controller.js index 1dd007a3b3..254c67518b 100644 --- a/ext/js/pages/settings/dictionary-import-controller.js +++ b/ext/js/pages/settings/dictionary-import-controller.js @@ -162,6 +162,7 @@ export class DictionaryImportController { {property: 'kanji', element: querySelectorNotNull(querySelectorNotNull(document, '#recommended-kanji-dictionaries'), '.recommended-dictionary-list')}, {property: 'frequency', element: querySelectorNotNull(querySelectorNotNull(document, '#recommended-frequency-dictionaries'), '.recommended-dictionary-list')}, {property: 'grammar', element: querySelectorNotNull(querySelectorNotNull(document, '#recommended-grammar-dictionaries'), '.recommended-dictionary-list')}, + {property: 'pronunciation', element: querySelectorNotNull(querySelectorNotNull(document, '#recommended-pronunciation-dictionaries'), '.recommended-dictionary-list')}, ]; const language = (await this._settingsController.getOptions()).general.language; diff --git a/ext/welcome.html b/ext/welcome.html index f801beba66..b94403274c 100644 --- a/ext/welcome.html +++ b/ext/welcome.html @@ -498,6 +498,10 @@

Frequency Dictionaries

Grammar Dictionaries

+