From 488072ad5d0a1305d1e6d089fe6283e4d6716e6d Mon Sep 17 00:00:00 2001 From: MarvNC Date: Fri, 2 Feb 2024 21:38:41 -0800 Subject: [PATCH] Rename `languages` to `LANGUAGES_DATA` --- src/constants.js | 4 ++-- src/util/entryParse/parseEntryToJson.js | 4 ++-- src/util/yomitan/convertSenseToSC.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/constants.js b/src/constants.js index 40ed719..3a273d8 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,7 +1,7 @@ /** * @type {Record} */ -const languages = { +const LANGUAGES_DATA = { yue: { name: '廣東話', shortName: '粵', @@ -79,7 +79,7 @@ const COMPRESSED_IMAGES_FOLDER = './compressedImages'; const IMAGE_RESIZE_WIDTH = 400; export { - languages, + LANGUAGES_DATA, IMAGE_FOLDER, COMPRESSED_IMAGES_FOLDER, IMAGE_RESIZE_WIDTH, diff --git a/src/util/entryParse/parseEntryToJson.js b/src/util/entryParse/parseEntryToJson.js index f0eb6b4..f58702c 100644 --- a/src/util/entryParse/parseEntryToJson.js +++ b/src/util/entryParse/parseEntryToJson.js @@ -1,4 +1,4 @@ -import { languages } from '../../constants.js'; +import { LANGUAGES_DATA } from '../../constants.js'; /** * @@ -158,7 +158,7 @@ function parseLanguageData(text) { continue; } // Check if the language is a possible language - if (!languages[matchedLang]) { + if (!LANGUAGES_DATA[matchedLang]) { throw new Error(`Invalid language: ${matchedLang}`); } // Else a language is found diff --git a/src/util/yomitan/convertSenseToSC.js b/src/util/yomitan/convertSenseToSC.js index b5635ca..c6cf585 100644 --- a/src/util/yomitan/convertSenseToSC.js +++ b/src/util/yomitan/convertSenseToSC.js @@ -1,4 +1,4 @@ -import { languages } from '../../constants.js'; +import { LANGUAGES_DATA } from '../../constants.js'; import { isStringSentence } from '../textHandling/textUtils.js'; import { convertTextToSC } from './parseTextToSC.js'; @@ -187,7 +187,7 @@ function convertLanguageEntryToListItems( * @type {import('yomichan-dict-builder/dist/types/yomitan/termbank').StructuredContent[]} */ const languageLiScArray = []; - const languageInfo = languages[language]; + const languageInfo = LANGUAGES_DATA[language]; for (const languageText of languageTexts) { /** * @type {import('yomichan-dict-builder/dist/types/yomitan/termbank').StructuredContent[]}