diff --git a/frappe/public/js/frappe/views/workspace/blocks/header.js b/frappe/public/js/frappe/views/workspace/blocks/header.js index b5b42796d4..072b054bad 100644 --- a/frappe/public/js/frappe/views/workspace/blocks/header.js +++ b/frappe/public/js/frappe/views/workspace/blocks/header.js @@ -104,8 +104,16 @@ export default class Header extends Block { this._data = this.normalizeData(data); if (data.text !== undefined) { - let text = this._data.text || ""; + let text = __(this._data.text) || ""; const contains_html_tag = /<[a-z][\s\S]*>/i.test(text); + + // apply translation to header text + let div = document.createElement("div"); + div.innerHTML = text; + let only_text = div.innerText; + only_text = frappe.utils.escape_html(only_text); + text = text.replace(only_text, __(only_text)); + this._element.innerHTML = contains_html_tag ? text : `${text}`;