diff --git a/api/js/etemplate/et2_core_baseWidget.js b/api/js/etemplate/et2_core_baseWidget.js index 5297e923e1..3a7324ea48 100644 --- a/api/js/etemplate/et2_core_baseWidget.js +++ b/api/js/etemplate/et2_core_baseWidget.js @@ -209,13 +209,6 @@ var et2_baseWidget = /** @class */ (function (_super) { if (_value == "" && !this._tooltipElem) { return; } - // allow statustext to contain multiple translated sub-strings eg: {Firstname}.{Lastname} - if (_value.indexOf('{') !== -1) { - var egw = this.egw(); - _value = _value.replace(/{([^}]+)}/g, function (str, p1) { - return egw.lang(p1); - }); - } this.statustext = _value; //Get the domnode the tooltip should be attached to var elem = jQuery(this.getTooltipElement()); diff --git a/api/js/etemplate/et2_core_baseWidget.ts b/api/js/etemplate/et2_core_baseWidget.ts index 843fe14221..c4b5a6b17a 100644 --- a/api/js/etemplate/et2_core_baseWidget.ts +++ b/api/js/etemplate/et2_core_baseWidget.ts @@ -282,16 +282,6 @@ export class et2_baseWidget extends et2_DOMWidget implements et2_IAligned return; } - // allow statustext to contain multiple translated sub-strings eg: {Firstname}.{Lastname} - if (_value.indexOf('{') !== -1) - { - var egw = this.egw(); - _value = _value.replace(/{([^}]+)}/g, function(str,p1) - { - return egw.lang(p1); - }); - } - this.statustext = _value; //Get the domnode the tooltip should be attached to diff --git a/api/js/etemplate/et2_core_widget.js b/api/js/etemplate/et2_core_widget.js index 64f69d3056..9142b3f407 100644 --- a/api/js/etemplate/et2_core_widget.js +++ b/api/js/etemplate/et2_core_widget.js @@ -483,14 +483,28 @@ var et2_widget = /** @class */ (function (_super) { } } } - // Translate the attributes - for (var key in _attrs) { - if (_attrs[key] && typeof this.attributes[key] != "undefined") { - if (this.attributes[key].translate === true || - (this.attributes[key].translate === "!no_lang" && !_attrs["no_lang"])) { - _attrs[key] = this.egw().lang(_attrs[key]); + var _loop_1 = function () { + if (_attrs[key] && typeof this_1.attributes[key] != "undefined") { + if (this_1.attributes[key].translate === true || + (this_1.attributes[key].translate === "!no_lang" && !_attrs["no_lang"])) { + var value = _attrs[key]; + // allow statustext to contain multiple translated sub-strings eg: {Firstname}.{Lastname} + if (value.indexOf('{') !== -1) { + var egw_1 = this_1.egw(); + _attrs[key] = value.replace(/{([^}]+)}/g, function (str, p1) { + return egw_1.lang(p1); + }); + } + else { + _attrs[key] = this_1.egw().lang(value); + } } } + }; + var this_1 = this; + // Translate the attributes + for (var key in _attrs) { + _loop_1(); } }; /** diff --git a/api/js/etemplate/et2_core_widget.ts b/api/js/etemplate/et2_core_widget.ts index fb8a03badd..3e41b11aec 100644 --- a/api/js/etemplate/et2_core_widget.ts +++ b/api/js/etemplate/et2_core_widget.ts @@ -625,7 +625,20 @@ export class et2_widget extends ClassWithAttributes if (_attrs[key] && typeof this.attributes[key] != "undefined") { if (this.attributes[key].translate === true || (this.attributes[key].translate === "!no_lang" && !_attrs["no_lang"])) { - _attrs[key] = this.egw().lang(_attrs[key]); + let value = _attrs[key]; + // allow statustext to contain multiple translated sub-strings eg: {Firstname}.{Lastname} + if (value.indexOf('{') !== -1) + { + const egw = this.egw(); + _attrs[key] = value.replace(/{([^}]+)}/g, function(str,p1) + { + return egw.lang(p1); + }); + } + else + { + _attrs[key] = this.egw().lang(value); + } } } }