From d8440964149b7c42b528094da2a7e112bf89bc79 Mon Sep 17 00:00:00 2001 From: Christoph Reiter <reiter.christoph@gmail.com> Date: Tue, 6 Jul 2021 14:03:53 +0200 Subject: [PATCH] tugraz-logo: extra i18next instance per component This was forgotten ebcause it isn't used in the tests currently --- packages/app-shell/src/tugraz-logo.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/app-shell/src/tugraz-logo.js b/packages/app-shell/src/tugraz-logo.js index 901b0725..7ea634bc 100644 --- a/packages/app-shell/src/tugraz-logo.js +++ b/packages/app-shell/src/tugraz-logo.js @@ -1,16 +1,15 @@ import {html, css} from 'lit-element'; import * as commonStyles from '@dbp-toolkit/common/styles'; -import {createI18nInstance} from './i18n.js'; +import {createInstance} from './i18n.js'; import {AdapterLitElement} from "@dbp-toolkit/provider/src/adapter-lit-element"; -const i18n = createI18nInstance(); - export class TUGrazLogo extends AdapterLitElement { constructor() { super(); - this.lang = i18n.language; + this._i18n = createInstance(); + this.lang = this._i18n.language; } static get properties() { @@ -23,7 +22,7 @@ export class TUGrazLogo extends AdapterLitElement { update(changedProperties) { changedProperties.forEach((oldValue, propName) => { if (propName === "lang") { - i18n.changeLanguage(this.lang); + this._i18n.changeLanguage(this.lang); } }); super.update(changedProperties); @@ -67,6 +66,7 @@ export class TUGrazLogo extends AdapterLitElement { } render() { + const i18n = this._i18n; return html` <a href="https://www.tugraz.at" title="TU Graz Home" target="_blank" rel="noopener"> <div id="claim"> -- GitLab