From 41bfbd7b74ab769fb93a5a3669f9cac892e6c992 Mon Sep 17 00:00:00 2001 From: seth-js <83692925+seth-js@users.noreply.github.com> Date: Tue, 4 Feb 2025 21:10:51 -0600 Subject: [PATCH 1/3] add norwegian --- ext/data/recommended-dictionaries.json | 28 +++++++++++++ ext/data/recommended-settings.json | 52 +++++++++++++++++++++++++ ext/js/language/language-descriptors.js | 18 +++++++++ types/ext/language-descriptors.d.ts | 6 +++ 4 files changed, 104 insertions(+) diff --git a/ext/data/recommended-dictionaries.json b/ext/data/recommended-dictionaries.json index 1b8134984f..4dede6ecb5 100644 --- a/ext/data/recommended-dictionaries.json +++ b/ext/data/recommended-dictionaries.json @@ -397,6 +397,20 @@ } ] }, + "nb": { + "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" + } + ] + }, "nl": { "frequency": [], "grammar": [], @@ -411,6 +425,20 @@ } ] }, + "nn": { + "frequency": [], + "grammar": [], + "kanji": [], + "pronunciation": [], + "terms": [ + { + "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..8838788715 100644 --- a/ext/data/recommended-settings.json +++ b/ext/data/recommended-settings.json @@ -381,6 +381,32 @@ "description": "Turn off Yomitan's internal parser for languages with spaces." } ], + "nb": [ + { + "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." + } + ], "nl": [ { "modification": { @@ -407,6 +433,32 @@ "description": "Turn off Yomitan's internal parser for languages with spaces." } ], + "nn": [ + { + "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..4638ff6ca5 100644 --- a/ext/js/language/language-descriptors.js +++ b/ext/js/language/language-descriptors.js @@ -291,6 +291,15 @@ const languageDescriptors = [ exampleText: 'kiteb', textPreprocessors: capitalizationPreprocessors, }, + { + iso: 'nb', + iso639_3: 'nob', + name: 'Norwegian Bokmål', + exampleText: 'lese', + textPreprocessors: { + ...capitalizationPreprocessors, + }, + }, { iso: 'nl', iso639_3: 'nld', @@ -298,6 +307,15 @@ const languageDescriptors = [ exampleText: 'lezen', textPreprocessors: capitalizationPreprocessors, }, + { + iso: 'nn', + iso639_3: 'nno', + name: 'Norwegian Nynorsk', + 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..3b239efe6c 100644 --- a/types/ext/language-descriptors.d.ts +++ b/types/ext/language-descriptors.d.ts @@ -170,9 +170,15 @@ type AllTextProcessors = { mt: { pre: CapitalizationPreprocessors; }; + nb: { + pre: CapitalizationPreprocessors; + }; nl: { pre: CapitalizationPreprocessors; }; + nn: { + pre: CapitalizationPreprocessors; + }; pl: { pre: CapitalizationPreprocessors; }; From 9b5ecb81a53c022d2783503bcd78a062e5074f66 Mon Sep 17 00:00:00 2001 From: seth-js <83692925+seth-js@users.noreply.github.com> Date: Tue, 4 Feb 2025 22:02:24 -0600 Subject: [PATCH 2/3] change iso to better support audio Changes ISO 639-3 code to support fetching from Lingua Libre. --- ext/js/language/language-descriptors.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/js/language/language-descriptors.js b/ext/js/language/language-descriptors.js index 4638ff6ca5..44f3b3039e 100644 --- a/ext/js/language/language-descriptors.js +++ b/ext/js/language/language-descriptors.js @@ -293,7 +293,7 @@ const languageDescriptors = [ }, { iso: 'nb', - iso639_3: 'nob', + iso639_3: 'nor', name: 'Norwegian Bokmål', exampleText: 'lese', textPreprocessors: { @@ -309,7 +309,7 @@ const languageDescriptors = [ }, { iso: 'nn', - iso639_3: 'nno', + iso639_3: 'nor', name: 'Norwegian Nynorsk', exampleText: 'lese', textPreprocessors: { From 7c99ae389eeb94396ceeff612a6601c2d9603694 Mon Sep 17 00:00:00 2001 From: seth-js <83692925+seth-js@users.noreply.github.com> Date: Wed, 5 Feb 2025 16:47:57 -0600 Subject: [PATCH 3/3] merge two options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merges Bokmål and Nynorsk into one language option. --- ext/data/recommended-dictionaries.json | 22 +++++++------------ ext/data/recommended-settings.json | 28 +------------------------ ext/js/language/language-descriptors.js | 13 ++---------- types/ext/language-descriptors.d.ts | 5 +---- 4 files changed, 11 insertions(+), 57 deletions(-) diff --git a/ext/data/recommended-dictionaries.json b/ext/data/recommended-dictionaries.json index 4dede6ecb5..8ded4f969a 100644 --- a/ext/data/recommended-dictionaries.json +++ b/ext/data/recommended-dictionaries.json @@ -397,20 +397,6 @@ } ] }, - "nb": { - "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" - } - ] - }, "nl": { "frequency": [], "grammar": [], @@ -425,12 +411,18 @@ } ] }, - "nn": { + "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.", diff --git a/ext/data/recommended-settings.json b/ext/data/recommended-settings.json index 8838788715..b4df53efbd 100644 --- a/ext/data/recommended-settings.json +++ b/ext/data/recommended-settings.json @@ -381,32 +381,6 @@ "description": "Turn off Yomitan's internal parser for languages with spaces." } ], - "nb": [ - { - "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." - } - ], "nl": [ { "modification": { @@ -433,7 +407,7 @@ "description": "Turn off Yomitan's internal parser for languages with spaces." } ], - "nn": [ + "no": [ { "modification": { "action": "set", diff --git a/ext/js/language/language-descriptors.js b/ext/js/language/language-descriptors.js index 44f3b3039e..29fd7b2f1c 100644 --- a/ext/js/language/language-descriptors.js +++ b/ext/js/language/language-descriptors.js @@ -291,15 +291,6 @@ const languageDescriptors = [ exampleText: 'kiteb', textPreprocessors: capitalizationPreprocessors, }, - { - iso: 'nb', - iso639_3: 'nor', - name: 'Norwegian Bokmål', - exampleText: 'lese', - textPreprocessors: { - ...capitalizationPreprocessors, - }, - }, { iso: 'nl', iso639_3: 'nld', @@ -308,9 +299,9 @@ const languageDescriptors = [ textPreprocessors: capitalizationPreprocessors, }, { - iso: 'nn', + iso: 'no', iso639_3: 'nor', - name: 'Norwegian Nynorsk', + name: 'Norwegian', exampleText: 'lese', textPreprocessors: { ...capitalizationPreprocessors, diff --git a/types/ext/language-descriptors.d.ts b/types/ext/language-descriptors.d.ts index 3b239efe6c..75463bf0d7 100644 --- a/types/ext/language-descriptors.d.ts +++ b/types/ext/language-descriptors.d.ts @@ -170,13 +170,10 @@ type AllTextProcessors = { mt: { pre: CapitalizationPreprocessors; }; - nb: { - pre: CapitalizationPreprocessors; - }; nl: { pre: CapitalizationPreprocessors; }; - nn: { + no: { pre: CapitalizationPreprocessors; }; pl: {