From 5ffc0910a9d4a6a9ea4fa14999667bf8dbd75eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20=C4=8Cern=C3=BD?= Date: Wed, 20 Dec 2023 20:20:02 +0100 Subject: [PATCH] Fix #1520: Allowed languages are not working (cherry picked from commit 157a89195018d2ef7ad11e77d9a782bec2f3cd44) --- powerauth-webflow/src/main/js/reducers/localeReducer.js | 7 +++++++ powerauth-webflow/src/main/resources/templates/index.html | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/powerauth-webflow/src/main/js/reducers/localeReducer.js b/powerauth-webflow/src/main/js/reducers/localeReducer.js index d07afd561..b82777308 100644 --- a/powerauth-webflow/src/main/js/reducers/localeReducer.js +++ b/powerauth-webflow/src/main/js/reducers/localeReducer.js @@ -33,8 +33,15 @@ export default function reducer(state = {locale: I18N_EN.locale, messages: I18N_ return {...state, locale: I18N_UK.locale, messages: I18N_UK.messages}; } else if (action.locale === "ro") { return {...state, locale: I18N_RO.locale, messages: I18N_RO.messages}; + } else if (action.locale === "de") { + return {...state, locale: I18N_DE.locale, messages: I18N_DE.messages}; + } else if (action.locale === "fr") { + return {...state, locale: I18N_FR.locale, messages: I18N_FR.messages}; + } else if (action.locale === "es") { + return {...state, locale: I18N_ES.locale, messages: I18N_ES.messages}; } + return state; default: return state; diff --git a/powerauth-webflow/src/main/resources/templates/index.html b/powerauth-webflow/src/main/resources/templates/index.html index 521a36fbc..8cc5ceb70 100644 --- a/powerauth-webflow/src/main/resources/templates/index.html +++ b/powerauth-webflow/src/main/resources/templates/index.html @@ -43,6 +43,10 @@ var I18N_CS = {locale: 'cs', messages: JSON.parse(/*[[${i18n_CS}]]*/)}; var I18N_UK = {locale: 'uk', messages: JSON.parse(/*[[${i18n_UK}]]*/)}; var I18N_RO = {locale: 'ro', messages: JSON.parse(/*[[${i18n_RO}]]*/)}; + var I18N_DE = {locale: 'de', messages: JSON.parse(/*[[${i18n_DE}]]*/)}; + var I18N_FR = {locale: 'fr', messages: JSON.parse(/*[[${i18n_FR}]]*/)}; + var I18N_ES = {locale: 'es', messages: JSON.parse(/*[[${i18n_ES}]]*/)}; + var csrf = {headerName: [[${_csrf.headerName}]], token: [[${_csrf.token}]]};