Skip to content
Snippets Groups Projects
Commit 21625a98 authored by Kocher, Manuel's avatar Kocher, Manuel
Browse files

Remove innerText from dbp-translation component

parent a494d5e0
No related branches found
No related tags found
No related merge requests found
Pipeline #221483 passed
...@@ -15,7 +15,6 @@ export class Translation extends DBPLitElement { ...@@ -15,7 +15,6 @@ export class Translation extends DBPLitElement {
// dir and i18next instance of translation overrides // dir and i18next instance of translation overrides
this._i18n = createInstance(); this._i18n = createInstance();
this.langDir = ''; this.langDir = '';
this.innerText = '';
} }
...@@ -77,19 +76,15 @@ export class Translation extends DBPLitElement { ...@@ -77,19 +76,15 @@ export class Translation extends DBPLitElement {
// request to i18n translation // request to i18n translation
if (this.interpolation && this.unsafe) { if (this.interpolation && this.unsafe) {
this.innerText = this._i18n.t(this.key, this.interpolation);
translation = unsafeHTML(this._i18n.t(this.key, this.interpolation)); translation = unsafeHTML(this._i18n.t(this.key, this.interpolation));
} }
else if (this.interpolation) { else if (this.interpolation) {
this.innerText = this._i18n.t(this.key, this.interpolation);
translation = this._i18n.t(this.key, this.interpolation); translation = this._i18n.t(this.key, this.interpolation);
} }
else if (this.unsafe) { else if (this.unsafe) {
this.innerText = this._i18n.t(this.key);
translation = unsafeHTML(this._i18n.t(this.key)); translation = unsafeHTML(this._i18n.t(this.key));
} }
else { else {
this.innerText = this._i18n.t(this.key);
translation = this._i18n.t(this.key); translation = this._i18n.t(this.key);
} }
...@@ -103,12 +98,10 @@ export class Translation extends DBPLitElement { ...@@ -103,12 +98,10 @@ export class Translation extends DBPLitElement {
|| window.location.hash.includes('debug')) { || window.location.hash.includes('debug')) {
keyComment = unsafeHTML("<!-- key: " + this.key + "-->"); keyComment = unsafeHTML("<!-- key: " + this.key + "-->");
} else if (this._i18n.hasResourceBundle(this.lang, overrideNamespace)){ } else if (this._i18n.hasResourceBundle(this.lang, overrideNamespace)){
this.innerText = "";
translation = ""; translation = "";
keyComment = unsafeHTML("<!-- key '" + this.key + "' not found! -->"); keyComment = unsafeHTML("<!-- key '" + this.key + "' not found! -->");
console.error("Key '" + this.key + "' not found!"); console.error("Key '" + this.key + "' not found!");
} else { } else {
this.innerText = "";
translation = ""; translation = "";
keyComment = unsafeHTML("<!-- key '" + this.key + "' and namespace '" + overrideNamespace + "' not found! -->"); keyComment = unsafeHTML("<!-- key '" + this.key + "' and namespace '" + overrideNamespace + "' not found! -->");
console.error("Key '" + this.key + "' and namespace '" + overrideNamespace + "' not found!"); console.error("Key '" + this.key + "' and namespace '" + overrideNamespace + "' not found!");
......
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