diff --git a/src/layouts/home-assistant.ts b/src/layouts/home-assistant.ts index f955793a3a75..f9781eef5db5 100644 --- a/src/layouts/home-assistant.ts +++ b/src/layouts/home-assistant.ts @@ -173,9 +173,6 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) { // @ts-ignore this._loadHassTranslations(this.hass!.language, "state"); - // @ts-ignore - this._loadHassTranslations(this.hass!.language, "exceptions"); - document.addEventListener( "visibilitychange", () => this._checkVisibility(), diff --git a/src/state/connection-mixin.ts b/src/state/connection-mixin.ts index cafc9cf46f04..e578f2b230e1 100644 --- a/src/state/connection-mixin.ts +++ b/src/state/connection-mixin.ts @@ -122,10 +122,16 @@ export const connectionMixin = >( } if (notifyOnError) { forwardHaptic("failure"); - const localizedErrorMessage = (this as any).hass.localize( - `component.${err.translation_domain}.exceptions.${err.translation_key}.message`, - err.translation_placeholders + const lokalize = await this.hass?.loadBackendTranslation( + "exceptions", + domain ); + const localizedErrorMessage = + lokalize && + lokalize( + `component.${err.translation_domain}.exceptions.${err.translation_key}.message`, + err.translation_placeholders + ); const message = localizedErrorMessage || (this as any).hass.localize(