From 75824b0bd9f695134b8552652797eae80f4a7b2e Mon Sep 17 00:00:00 2001 From: seth-js <83692925+seth-js@users.noreply.github.com> Date: Wed, 5 Feb 2025 17:04:49 -0600 Subject: [PATCH] add norwegian (#1804) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add norwegian * change iso to better support audio Changes ISO 639-3 code to support fetching from Lingua Libre. * merge two options Merges Bokmål and Nynorsk into one language option. --- ext/data/recommended-dictionaries.json | 20 +++++++++++++++++++ ext/data/recommended-settings.json | 26 +++++++++++++++++++++++++ ext/js/language/language-descriptors.js | 9 +++++++++ types/ext/language-descriptors.d.ts | 3 +++ 4 files changed, 58 insertions(+) diff --git a/ext/data/recommended-dictionaries.json b/ext/data/recommended-dictionaries.json index 1b8134984f..8ded4f969a 100644 --- a/ext/data/recommended-dictionaries.json +++ b/ext/data/recommended-dictionaries.json @@ -411,6 +411,26 @@ } ] }, + "no": { + "frequency": [], + "grammar": [], + "kanji": [], + "pronunciation": [], + "terms": [ + { + "name": "kty-nb-en", + "description": "Norwegian Bokmål to English dictionary created from Wiktionary data.", + "homepage": "https://github.com/yomidevs/kaikki-to-yomitan/blob/master/downloads.md", + "downloadUrl": "https://github.com/yomidevs/kaikki-to-yomitan/releases/latest/download/kty-nb-en.zip" + }, + { + "name": "kty-nn-en", + "description": "Norwegian Nynorsk to English dictionary created from Wiktionary data.", + "homepage": "https://github.com/yomidevs/kaikki-to-yomitan/blob/master/downloads.md", + "downloadUrl": "https://github.com/yomidevs/kaikki-to-yomitan/releases/latest/download/kty-nn-en.zip" + } + ] + }, "pl": { "frequency": [], "grammar": [], diff --git a/ext/data/recommended-settings.json b/ext/data/recommended-settings.json index bab913a11c..b4df53efbd 100644 --- a/ext/data/recommended-settings.json +++ b/ext/data/recommended-settings.json @@ -407,6 +407,32 @@ "description": "Turn off Yomitan's internal parser for languages with spaces." } ], + "no": [ + { + "modification": { + "action": "set", + "path": "scanning.scanResolution", + "value": "word" + }, + "description": "Scan text one word at a time (as opposed to one character)." + }, + { + "modification": { + "action": "set", + "path": "translation.searchResolution", + "value": "word" + }, + "description": "Lookup whole words in the dictionary." + }, + { + "modification": { + "action": "set", + "path": "parsing.enableScanningParser", + "value": false + }, + "description": "Turn off Yomitan's internal parser for languages with spaces." + } + ], "pl": [ { "modification": { diff --git a/ext/js/language/language-descriptors.js b/ext/js/language/language-descriptors.js index 29ff551548..29fd7b2f1c 100644 --- a/ext/js/language/language-descriptors.js +++ b/ext/js/language/language-descriptors.js @@ -298,6 +298,15 @@ const languageDescriptors = [ exampleText: 'lezen', textPreprocessors: capitalizationPreprocessors, }, + { + iso: 'no', + iso639_3: 'nor', + name: 'Norwegian', + exampleText: 'lese', + textPreprocessors: { + ...capitalizationPreprocessors, + }, + }, { iso: 'pl', iso639_3: 'pol', diff --git a/types/ext/language-descriptors.d.ts b/types/ext/language-descriptors.d.ts index 1de283b0b6..75463bf0d7 100644 --- a/types/ext/language-descriptors.d.ts +++ b/types/ext/language-descriptors.d.ts @@ -173,6 +173,9 @@ type AllTextProcessors = { nl: { pre: CapitalizationPreprocessors; }; + no: { + pre: CapitalizationPreprocessors; + }; pl: { pre: CapitalizationPreprocessors; };