diff --git a/api/js/etemplate/Et2Widget/Et2Widget.ts b/api/js/etemplate/Et2Widget/Et2Widget.ts index cf29d0db4d..1508552246 100644 --- a/api/js/etemplate/Et2Widget/Et2Widget.ts +++ b/api/js/etemplate/Et2Widget/Et2Widget.ts @@ -103,10 +103,18 @@ const Et2WidgetMixin = (superClass) => /** * Tooltip which is shown for this element on hover */ - statustext: {type: String}, + statustext: {type: String, translate: true}, - // Defined in parent hierarchy - //label: {type: String}, + /** + * The label of the widget + * This is usually displayed in some way. It's also important for accessability. + * This is defined in the parent somewhere, and re-defining it causes labels to disappear + * + label: { + type: String, + translate: true + }, + */ onclick: { type: Function @@ -134,6 +142,20 @@ const Et2WidgetMixin = (superClass) => }; } + /** + * List of properties that get translated + * Done separately to not interfere with properties - if we re-define label property, + * labels go missing. + * @returns {{statustext : boolean, label : boolean}} + */ + static get translate() + { + return { + label: true, + statustext: true + } + } + /** * Widget Mixin constructor * @@ -1019,6 +1041,10 @@ export function loadWebComponent(_nodeName : string, _template_node, parent : Et break; default: attrValue = mgr.expandName(attrValue); + if(!_template_node.getAttribute("no_lang") && widget_class.translate[attribute]) + { + attrValue = widget.egw().lang(attrValue); + } break; }