From fe7d79cee6b2bf8bd7cab54f6024ca8578169d55 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 10 Nov 2020 23:44:59 +0100 Subject: [PATCH] Load system health translations from backend (#7643) --- src/data/translation.ts | 3 +- src/panels/config/info/system-health-card.ts | 4 ++- src/translations/en.json | 34 +------------------- 3 files changed, 6 insertions(+), 35 deletions(-) diff --git a/src/data/translation.ts b/src/data/translation.ts index 8a11515458..4316242262 100644 --- a/src/data/translation.ts +++ b/src/data/translation.ts @@ -17,7 +17,8 @@ export type TranslationCategory = | "config" | "options" | "device_automation" - | "mfa_setup"; + | "mfa_setup" + | "system_health"; export const fetchTranslationPreferences = (hass: HomeAssistant) => fetchFrontendUserData(hass.connection, "language"); diff --git a/src/panels/config/info/system-health-card.ts b/src/panels/config/info/system-health-card.ts index b660328ff4..775602dd6d 100644 --- a/src/panels/config/info/system-health-card.ts +++ b/src/panels/config/info/system-health-card.ts @@ -106,7 +106,7 @@ class SystemHealthCard extends LitElement { ${this.hass.localize( - `ui.panel.config.info.system_health.checks.${domain}.${key}` + `component.${domain}.system_health.info.${key}` ) || key} ${value} @@ -170,6 +170,8 @@ class SystemHealthCard extends LitElement { protected firstUpdated(changedProps) { super.firstUpdated(changedProps); + this.hass!.loadBackendTranslation("system_health"); + if (!this.hass!.config.components.includes("system_health")) { this._info = { system_health: { diff --git a/src/translations/en.json b/src/translations/en.json index 062751aac7..e4bf549899 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -892,39 +892,7 @@ "issues": "Issues", "system_health": { "manage": "Manage", - "more_info": "more info", - "checks": { - "homeassistant": { - "arch": "CPU Architecture", - "dev": "Development", - "docker": "Docker", - "hassio": "HassOS", - "installation_type": "Installation Type", - "os_name": "Operating System Name", - "os_version": "Operating System Version", - "python_version": "Python Version", - "timezone": "Timezone", - "version": "Version", - "virtualenv": "Virtual Environment" - }, - "cloud": { - "can_reach_cert_server": "Reach Certificate Server", - "can_reach_cloud": "Reach Home Assistant Cloud", - "can_reach_cloud_auth": "Reach Authentication Server", - "relayer_connected": "Relayer Connected", - "remote_connected": "Remote Connected", - "remote_enabled": "Remote Enabled", - "alexa_enabled": "Alexa Enabled", - "google_enabled": "Google Enabled", - "logged_in": "Logged In", - "subscription_expiration": "Subscription Expiration" - }, - "lovelace": { - "dashboards": "Dashboards", - "mode": "Mode", - "resources": "Resources" - } - } + "more_info": "more info" } }, "logs": {