Make log levels translatable (#8761)

This commit is contained in:
Philip Allgaier 2021-03-30 20:19:50 +02:00 committed by GitHub
parent 3888c56f1a
commit afe3831f25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 4 deletions

View File

@ -72,7 +72,15 @@ class DialogSystemLogDetail extends LitElement {
<ha-svg-icon .path=${mdiClose}></ha-svg-icon> <ha-svg-icon .path=${mdiClose}></ha-svg-icon>
</mwc-icon-button> </mwc-icon-button>
<span slot="title"> <span slot="title">
${this.hass.localize("ui.panel.config.logs.details", "level", html`<span class="${item.level.toLowerCase()}">${item.level}</span>`)} ${this.hass.localize(
"ui.panel.config.logs.details",
"level",
html`<span class="${item.level.toLowerCase()}"
>${this.hass.localize(
"ui.panel.config.logs.level." + item.level.toLowerCase()
)}</span
>`
)}
</span> </span>
<mwc-icon-button id="copy" @click=${this._copyLog} slot="actionItems"> <mwc-icon-button id="copy" @click=${this._copyLog} slot="actionItems">
<ha-svg-icon .path=${mdiContentCopy}></ha-svg-icon> <ha-svg-icon .path=${mdiContentCopy}></ha-svg-icon>

View File

@ -72,7 +72,10 @@ export class SystemLogCard extends LitElement {
)} )}
${html`(<span class="${item.level.toLowerCase()}" ${html`(<span class="${item.level.toLowerCase()}"
>${item.level}</span >${this.hass.localize(
"ui.panel.config.logs.level." +
item.level.toLowerCase()
)}</span
>) `} >) `}
${integrations[idx] ${integrations[idx]
? domainToName( ? domainToName(

View File

@ -1047,11 +1047,18 @@
"details": "Log Details ({level})", "details": "Log Details ({level})",
"load_full_log": "Load Full Home Assistant Log", "load_full_log": "Load Full Home Assistant Log",
"loading_log": "Loading error 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!", "no_issues": "There are no new issues!",
"clear": "Clear", "clear": "Clear",
"refresh": "Refresh", "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": { "lovelace": {
"caption": "Lovelace Dashboards", "caption": "Lovelace Dashboards",