diff --git a/src/layouts/app/disconnect-toast-mixin.ts b/src/layouts/app/disconnect-toast-mixin.ts index 70411c3a0b..2905ed40f6 100644 --- a/src/layouts/app/disconnect-toast-mixin.ts +++ b/src/layouts/app/disconnect-toast-mixin.ts @@ -1,13 +1,14 @@ import { Constructor, LitElement } from "lit-element"; import { HassBaseEl } from "./hass-base-mixin"; import { HaToast } from "../../components/ha-toast"; +import { computeRTL } from "../../common/util/compute_rtl"; export default (superClass: Constructor) => class extends superClass { private _discToast?: HaToast; - protected hassConnected() { - super.hassConnected(); + protected firstUpdated(changedProps) { + super.firstUpdated(changedProps); // Need to load in advance because when disconnected, can't dynamically load code. import(/* webpackChunkName: "ha-toast" */ "../../components/ha-toast"); } @@ -24,10 +25,13 @@ export default (superClass: Constructor) => if (!this._discToast) { const el = document.createElement("ha-toast"); el.duration = 0; - el.text = this.hass!.localize("ui.notification_toast.connection_lost"); this._discToast = el; this.shadowRoot!.appendChild(el as any); } + this._discToast.dir = computeRTL(this.hass!); + this._discToast.text = this.hass!.localize( + "ui.notification_toast.connection_lost" + ); this._discToast.opened = true; } }; diff --git a/src/panels/config/area_registry/dialog-area-registry-detail.ts b/src/panels/config/area_registry/dialog-area-registry-detail.ts index bf8e0d8425..6a777ba1f3 100644 --- a/src/panels/config/area_registry/dialog-area-registry-detail.ts +++ b/src/panels/config/area_registry/dialog-area-registry-detail.ts @@ -51,7 +51,13 @@ class DialogAreaDetail extends LitElement { opened @opened-changed="${this._openedChanged}" > -

${this._params.entry ? this._params.entry.name : "New Area"}

+

+ ${this._params.entry + ? this._params.entry.name + : this.hass.localize( + "ui.panel.config.area_registry.editor.default_name" + )} +

${this._error ? html` @@ -62,7 +68,7 @@ class DialogAreaDetail extends LitElement { @@ -76,7 +82,9 @@ class DialogAreaDetail extends LitElement { @click="${this._deleteEntry}" .disabled=${this._submitting} > - DELETE + ${this.hass.localize( + "ui.panel.config.area_registry.editor.delete" + )} ` : html``} @@ -84,7 +92,13 @@ class DialogAreaDetail extends LitElement { @click="${this._updateEntry}" .disabled=${nameInvalid || this._submitting} > - ${this._params.entry ? "UPDATE" : "CREATE"} + ${this._params.entry + ? this.hass.localize( + "ui.panel.config.area_registry.editor.update" + ) + : this.hass.localize( + "ui.panel.config.area_registry.editor.create" + )} diff --git a/src/panels/config/area_registry/ha-config-area-registry.ts b/src/panels/config/area_registry/ha-config-area-registry.ts index 8fe412539e..43fb8bdc6f 100644 --- a/src/panels/config/area_registry/ha-config-area-registry.ts +++ b/src/panels/config/area_registry/ha-config-area-registry.ts @@ -50,7 +50,9 @@ class HaConfigAreaRegistry extends LitElement { return html` - Area Registry + + ${this.hass.localize("ui.panel.config.area_registry.picker.header")} + Areas are used to organize where devices are. This information will be used throughout Home Assistant to help you in organizing your @@ -74,10 +76,14 @@ class HaConfigAreaRegistry extends LitElement { ${this._items.length === 0 ? html`
- Looks like you have no areas yet! + ${this.hass.localize( + "ui.panel.config.area_registry.picker.no_areas" + )} - CREATE AREA + ${this.hass.localize( + "ui.panel.config.area_registry.picker.create_area" + )} +
` : html``} diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index 4d00ececa8..02d50e67f5 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -11,6 +11,7 @@ import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; import "@polymer/paper-icon-button/paper-icon-button"; import "@polymer/paper-fab/paper-fab"; +import { classMap } from "lit-html/directives/class-map"; import { h, render } from "preact"; @@ -24,6 +25,7 @@ import { haStyle } from "../../../resources/ha-style"; import { HomeAssistant } from "../../../types"; import { AutomationEntity, AutomationConfig } from "../../../data/automation"; import { navigate } from "../../../common/navigate"; +import { computeRTL } from "../../../common/util/compute_rtl"; function AutomationEditor(mountEl, props, mergeEl) { return render(h(Automation, props), mountEl, mergeEl); @@ -92,7 +94,12 @@ class HaAutomationEditor extends LitElement {
${this._errors}
` : ""} -
+
.content { padding-bottom: 24px; + direction: ltr; } paper-card { diff --git a/src/panels/config/cloud/ha-config-cloud-login.js b/src/panels/config/cloud/ha-config-cloud-login.js index 549569ee7c..17a47c497d 100644 --- a/src/panels/config/cloud/ha-config-cloud-login.js +++ b/src/panels/config/cloud/ha-config-cloud-login.js @@ -26,6 +26,7 @@ class HaConfigCloudLogin extends NavigateMixin(EventsMixin(PolymerElement)) { diff --git a/src/translations/en.json b/src/translations/en.json index 56f68e88d4..01aca9f1e3 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -530,7 +530,18 @@ "introduction": "Here it is possible to configure your components and Home Assistant. Not everything is possible to configure from the UI yet, but we're working on it.", "area_registry": { "caption": "Area Registry", - "description": "Overview of all areas in your home." + "description": "Overview of all areas in your home.", + "picker": { + "header": "Area Registry" + }, + "no_areas": "Looks like you have no areas yet!", + "create_area": "CREATE AREA", + "editor": { + "default_name": "New Area", + "delete": "DELETE", + "update": "UPDATE", + "create": "CREATE" + } }, "core": { "caption": "General", @@ -565,7 +576,11 @@ }, "customize": { "caption": "Customization", - "description": "Customize your entities" + "description": "Customize your entities", + "picker": { + "header": "Customization", + "introduction": "Tweak per-entity attributes. Added/edited customizations will take effect immediately. Removed customizations will take effect when the entity is updated." + } }, "automation": { "caption": "Automation", @@ -755,7 +770,17 @@ }, "entity_registry": { "caption": "Entity Registry", - "description": "Overview of all known entities." + "description": "Overview of all known entities.", + "picker": { + "header": "Entity Registry", + "unavailable": "(unavailable)" + }, + "editor": { + "unavailable": "This entity is not currently available.", + "default_name": "New Area", + "delete": "DELETE", + "update": "UPDATE" + } }, "person": { "caption": "People",