From 742cf3a07da709948f152a77306b5b4a86ed1ab8 Mon Sep 17 00:00:00 2001 From: Alex White Date: Sat, 10 Feb 2024 08:51:07 +0000 Subject: [PATCH] added null check in case of unintialised language --- Platform/WebServer/locales/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Platform/WebServer/locales/index.js b/Platform/WebServer/locales/index.js index 621fe5285a..d38873e3af 100644 --- a/Platform/WebServer/locales/index.js +++ b/Platform/WebServer/locales/index.js @@ -31,7 +31,8 @@ function addDataAttribute(value) { } function findTranslation(translationKey) { - const currentLanguage = UI.projects.education.spaces.docsSpace.language.toLowerCase() + const docsLanguauge = UI.projects.education.spaces.docsSpace.language + const currentLanguage = docsLanguauge === undefined ? 'en' : docsLanguauge.toLowerCase() const languageMatch = i18next.translator.resourceStore.data[currentLanguage] if(languageMatch !== undefined) { let value = languageMatch.translation