web: fix locale inconsistencies (#4888)
start fixing locale inconsistencies Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -50,10 +50,14 @@ export class AKElement extends LitElement {
|
||||
get activeTheme(): UiThemeEnum | undefined {
|
||||
return this._activeTheme;
|
||||
}
|
||||
private _handleLocaleChange: () => void;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.addEventListener(EVENT_LOCALE_CHANGE, this._handleLocaleChange);
|
||||
this._handleLocaleChange = (() => {
|
||||
this.requestUpdate();
|
||||
}).bind(this);
|
||||
window.addEventListener(EVENT_LOCALE_CHANGE, this._handleLocaleChange);
|
||||
}
|
||||
|
||||
protected createRenderRoot(): ShadowRoot | Element {
|
||||
@ -147,11 +151,7 @@ export class AKElement extends LitElement {
|
||||
|
||||
disconnectedCallback() {
|
||||
super.disconnectedCallback();
|
||||
this.removeEventListener(EVENT_LOCALE_CHANGE, this._handleLocaleChange);
|
||||
}
|
||||
|
||||
private _handleLocaleChange() {
|
||||
this.requestUpdate();
|
||||
window.removeEventListener(EVENT_LOCALE_CHANGE, this._handleLocaleChange);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -66,11 +66,15 @@ export class AggregateCard extends AKElement {
|
||||
: ""}`;
|
||||
}
|
||||
|
||||
renderHeader(): TemplateResult {
|
||||
return html`${this.header ? this.header : ""}`;
|
||||
}
|
||||
|
||||
render(): TemplateResult {
|
||||
return html`<div class="pf-c-card pf-c-card-aggregate">
|
||||
<div class="pf-c-card__header pf-l-flex pf-m-justify-content-space-between">
|
||||
<div class="pf-c-card__title">
|
||||
<i class="${ifDefined(this.icon)}"></i> ${this.header ? this.header : ""}
|
||||
<i class="${ifDefined(this.icon)}"></i> ${this.renderHeader()}
|
||||
</div>
|
||||
${this.renderHeaderLink()}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user