Skip to content

Commit

Permalink
Merge pull request Superalgos#5075 from Awhiteweb/feature/translation…
Browse files Browse the repository at this point in the history
…s-patch

added null check in case of unintialised language
  • Loading branch information
BastianMuc authored Feb 10, 2024
2 parents dcb80d6 + 742cf3a commit d23e492
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Platform/WebServer/locales/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d23e492

Please sign in to comment.