getting label / tooltip of images to be translated

not sure why this is necessary, as Et2Widgets lists label and statustext as to translate ...
This commit is contained in:
ralf 2022-09-06 10:41:08 +02:00
parent f204ff2ad5
commit 06ae750b32

View File

@ -80,6 +80,21 @@ export class Et2Image extends Et2Widget(SlotMixin(LitElement)) implements et2_ID
} }
} }
set_label(label)
{
this.label = label;
}
set label(label)
{
this.__label = this.egw().lang(label);
}
get label()
{
return this.__label;
}
get slots() get slots()
{ {
return { return {
@ -119,9 +134,9 @@ export class Et2Image extends Et2Widget(SlotMixin(LitElement)) implements et2_ID
return html` return html`
<img ${this.id ? html`id="${this.id}"` : ''} <img ${this.id ? html`id="${this.id}"` : ''}
src="${src}" src="${src}"
alt="${this.label}" alt="${this.egw().lang(this.label)}"
part="image" part="image"
title="${this.statustext || this.label}" title="${this.egw().lang(this.statustext || this.label)}"
>`; >`;
} }