From 1cab4909ef8bb43b3a605e8aa149caf387628ddf Mon Sep 17 00:00:00 2001 From: Andy Low <42089621+AndyLow91@users.noreply.github.com> Date: Fri, 6 Mar 2026 22:29:36 +0000 Subject: [PATCH] Fix Spanish translation JSON --- tests/language.test.js | 19 +++++++++++++++++++ translations/es_ES.json | 1 - 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/language.test.js b/tests/language.test.js index 0de87999..5acae578 100644 --- a/tests/language.test.js +++ b/tests/language.test.js @@ -1,6 +1,7 @@ 'use strict'; const fs = require('fs'); +const path = require('path'); require('should'); @@ -40,4 +41,22 @@ describe('language', function ( ) { language.translate('carbs', { ci: true }).should.equal('Sacharidy'); }); + it('parse every translation file as valid JSON', function () { + function parseTranslationTree (dirPath) { + fs.readdirSync(dirPath, { withFileTypes: true }).forEach(function(entry) { + var entryPath = path.join(dirPath, entry.name); + if (entry.isDirectory()) { + parseTranslationTree(entryPath); + return; + } + + if (path.extname(entry.name) === '.json') { + JSON.parse(fs.readFileSync(entryPath, 'utf8')); + } + }); + } + + parseTranslationTree(path.join(__dirname, '..', 'translations')); + }); + }); diff --git a/translations/es_ES.json b/translations/es_ES.json index f2fa9aab..26dd9ab9 100644 --- a/translations/es_ES.json +++ b/translations/es_ES.json @@ -704,5 +704,4 @@ "Weak API_SECRET detected. Please use a mix of small and CAPITAL letters, numbers and non-alphanumeric characters such as !#%&/ to reduce the risk of unauthorized access. The minimum length of the API_SECRET is 12 characters.": "Detectada API_SECRET débil. Por favor, utilice una mezcla de letras en minúscula y en mayúscula, números y caracteres no alfanuméricos como !#%&/ para reducir el riesgo de acceso no autorizado. La longitud mínima de la API_SECRET es de 12 caracteres.", "less than 1": "menos de 1", "MongoDB password and API_SECRET match. This is a really bad idea. Please change both and do not reuse passwords across the system.": "La contraseña de MongoDB y la API_SECRET coinciden. Esto es una muy mala idea. Por favor, cambie ambas contraseñas y no reutilice contraseñas en el sistema." - "virtAsstLaunch":"¿Qué quieres saber de Nightscout?" }