Skip to content
Snippets Groups Projects
Commit bfa6b63d authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire: Committed by Reiter, Christoph
Browse files

Implement dynamic language switching

parent 995b31b5
No related branches found
No related tags found
No related merge requests found
...@@ -54,7 +54,6 @@ class VPUAuth extends LitElement { ...@@ -54,7 +54,6 @@ class VPUAuth extends LitElement {
connectedCallback() { connectedCallback() {
super.connectedCallback(); super.connectedCallback();
i18n.changeLanguage(this.lang);
const href = window.location.href; const href = window.location.href;
// load Keycloak if we want to force the login or if we were redirected from the Keycloak login page // load Keycloak if we want to force the login or if we were redirected from the Keycloak login page
...@@ -191,6 +190,16 @@ class VPUAuth extends LitElement { ...@@ -191,6 +190,16 @@ class VPUAuth extends LitElement {
this.dispatchKeycloakDataUpdateEvent(); this.dispatchKeycloakDataUpdateEvent();
} }
update(changedProperties) {
changedProperties.forEach((oldValue, propName) => {
if (propName === "lang") {
i18n.changeLanguage(this.lang);
}
});
super.update(changedProperties);
}
render() { render() {
return html` return html`
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.min.css">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment