mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-18 23:06:40 +00:00
Localize automation logbook text (#22685)
* localize automation text * localize domain * fixup * split up * fixup * prettier
This commit is contained in:
parent
df3e4576db
commit
0488d199ac
@ -26,7 +26,10 @@ export class HaTraceLogbook extends LitElement {
|
|||||||
.entries=${this.logbookEntries}
|
.entries=${this.logbookEntries}
|
||||||
.narrow=${this.narrow}
|
.narrow=${this.narrow}
|
||||||
></ha-logbook-renderer>
|
></ha-logbook-renderer>
|
||||||
<hat-logbook-note .domain=${this.trace.domain}></hat-logbook-note>
|
<hat-logbook-note
|
||||||
|
.hass=${this.hass}
|
||||||
|
.domain=${this.trace.domain}
|
||||||
|
></hat-logbook-note>
|
||||||
`
|
`
|
||||||
: html`<div class="padded-box">
|
: html`<div class="padded-box">
|
||||||
No Logbook entries found for this step.
|
No Logbook entries found for this step.
|
||||||
|
@ -291,7 +291,10 @@ export class HaTracePathDetails extends LitElement {
|
|||||||
.entries=${entries}
|
.entries=${entries}
|
||||||
.narrow=${this.narrow}
|
.narrow=${this.narrow}
|
||||||
></ha-logbook-renderer>
|
></ha-logbook-renderer>
|
||||||
<hat-logbook-note .domain=${this.trace.domain}></hat-logbook-note>
|
<hat-logbook-note
|
||||||
|
.hass=${this.hass}
|
||||||
|
.domain=${this.trace.domain}
|
||||||
|
></hat-logbook-note>
|
||||||
`
|
`
|
||||||
: html`<div class="padded-box">
|
: html`<div class="padded-box">
|
||||||
${this.hass!.localize(
|
${this.hass!.localize(
|
||||||
|
@ -28,7 +28,10 @@ export class HaTraceTimeline extends LitElement {
|
|||||||
allowPick
|
allowPick
|
||||||
>
|
>
|
||||||
</hat-trace-timeline>
|
</hat-trace-timeline>
|
||||||
<hat-logbook-note .domain=${this.trace.domain}></hat-logbook-note>
|
<hat-logbook-note
|
||||||
|
.hass=${this.hass}
|
||||||
|
.domain=${this.trace.domain}
|
||||||
|
></hat-logbook-note>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +1,22 @@
|
|||||||
import { css, html, LitElement } from "lit";
|
import { css, LitElement } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
|
import type { HomeAssistant } from "../../types";
|
||||||
|
|
||||||
@customElement("hat-logbook-note")
|
@customElement("hat-logbook-note")
|
||||||
class HatLogbookNote extends LitElement {
|
class HatLogbookNote extends LitElement {
|
||||||
@property() public domain = "automation";
|
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||||
|
|
||||||
|
@property() public domain: "automation" | "script" = "automation";
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return html`
|
if (this.domain === "script") {
|
||||||
Not all shown logbook entries might be related to this ${this.domain}.
|
return this.hass.localize(
|
||||||
`;
|
"ui.panel.config.automation.trace.messages.not_all_entries_are_related_script_note"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return this.hass.localize(
|
||||||
|
"ui.panel.config.automation.trace.messages.not_all_entries_are_related_automation_note"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static styles = css`
|
static styles = css`
|
||||||
|
@ -3641,7 +3641,9 @@
|
|||||||
"stopped_unknown_reason": "Stopped because of unknown reason {reason} at {time} (runtime: {executiontime} seconds)",
|
"stopped_unknown_reason": "Stopped because of unknown reason {reason} at {time} (runtime: {executiontime} seconds)",
|
||||||
"disabled": "(disabled)",
|
"disabled": "(disabled)",
|
||||||
"triggered_by": "{triggeredBy, select, \n alias {{alias} triggered}\n other {Triggered} \n} {triggeredPath, select, \n trigger {by the {trigger}}\n other {manually} \n} at {time}",
|
"triggered_by": "{triggeredBy, select, \n alias {{alias} triggered}\n other {Triggered} \n} {triggeredPath, select, \n trigger {by the {trigger}}\n other {manually} \n} at {time}",
|
||||||
"path_error": "Unable to extract path {path}. Download trace and report as bug."
|
"path_error": "Unable to extract path {path}. Download trace and report as bug.",
|
||||||
|
"not_all_entries_are_related_automation_note": "Not all shown logbook entries might be related to this automation.",
|
||||||
|
"not_all_entries_are_related_script_note": "Not all shown logbook entries might be related to this script."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user