From afe3831f25370c1a040973678ee425f21209ca1c Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Tue, 30 Mar 2021 20:19:50 +0200 Subject: [PATCH] Make log levels translatable (#8761) --- src/panels/config/logs/dialog-system-log-detail.ts | 10 +++++++++- src/panels/config/logs/system-log-card.ts | 5 ++++- src/translations/en.json | 11 +++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/panels/config/logs/dialog-system-log-detail.ts b/src/panels/config/logs/dialog-system-log-detail.ts index 4744303163..90d4670eff 100644 --- a/src/panels/config/logs/dialog-system-log-detail.ts +++ b/src/panels/config/logs/dialog-system-log-detail.ts @@ -72,7 +72,15 @@ class DialogSystemLogDetail extends LitElement { - ${this.hass.localize("ui.panel.config.logs.details", "level", html`${item.level}`)} + ${this.hass.localize( + "ui.panel.config.logs.details", + "level", + html`${this.hass.localize( + "ui.panel.config.logs.level." + item.level.toLowerCase() + )}` + )} diff --git a/src/panels/config/logs/system-log-card.ts b/src/panels/config/logs/system-log-card.ts index b4a020014e..deff14e5f5 100644 --- a/src/panels/config/logs/system-log-card.ts +++ b/src/panels/config/logs/system-log-card.ts @@ -72,7 +72,10 @@ export class SystemLogCard extends LitElement { )} – ${html`(${item.level}${this.hass.localize( + "ui.panel.config.logs.level." + + item.level.toLowerCase() + )}) `} ${integrations[idx] ? domainToName( diff --git a/src/translations/en.json b/src/translations/en.json index f67c07c6ed..767360463e 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1047,11 +1047,18 @@ "details": "Log Details ({level})", "load_full_log": "Load Full Home Assistant Log", "loading_log": "Loading error log…", - "no_errors": "No errors have been reported.", + "no_errors": "No errors have been reported", "no_issues": "There are no new issues!", "clear": "Clear", "refresh": "Refresh", - "multiple_messages": "message first occurred at {time} and shows up {counter} times" + "multiple_messages": "message first occurred at {time} and shows up {counter} times", + "level": { + "critical": "CRITICAL", + "error": "ERROR", + "warning": "WARNING", + "info": "INFO", + "debug": "DEBUG" + } }, "lovelace": { "caption": "Lovelace Dashboards",