From 488f2fa66d0e97c86299de2a7e0694fd8f3acdc9 Mon Sep 17 00:00:00 2001 From: Yi-Ting Tu Date: Thu, 12 Dec 2024 14:45:09 -0500 Subject: [PATCH] Update build process to detect empty locale components --- scripts/buildScenes.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/buildScenes.mjs b/scripts/buildScenes.mjs index 8e0a621e..27224f11 100644 --- a/scripts/buildScenes.mjs +++ b/scripts/buildScenes.mjs @@ -31,7 +31,11 @@ langs.forEach((lang) => { // Load the strings from /locales/{lang}/gallery.json if it exists. const galleryStringsPath = path.join(__dirname, `../locales/${lang}/gallery.json`); if (fs.existsSync(galleryStringsPath)) { - const galleryStrings = JSON.parse(fs.readFileSync(galleryStringsPath).toString()).galleryData; + const galleryData = JSON.parse(fs.readFileSync(galleryStringsPath).toString()); + if (!galleryData.galleryData) { + return; + } + const galleryStrings = galleryData.galleryData; // Extract the strings from the galleryStrings object. sceneIDs.forEach((id) => { if (galleryStrings[sceneIDToCamelCase[id]]) {