Add missing translations to actions, triggers and conditions of device automations (#6002)

This commit is contained in:
Maciej Bieniek 2020-05-25 19:37:44 +02:00 committed by GitHub
parent 6b8cfe661c
commit 3faebaeb4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 7 deletions

View File

@ -51,14 +51,18 @@ export class HaDeviceAction extends LitElement {
.value=${deviceId}
@value-changed=${this._devicePicked}
.hass=${this.hass}
label="Device"
label=${this.hass.localize(
"ui.panel.config.automation.editor.actions.type.device_id.label"
)}
></ha-device-picker>
<ha-device-action-picker
.value=${this.action}
.deviceId=${deviceId}
@value-changed=${this._deviceActionPicked}
.hass=${this.hass}
label="Action"
label=${this.hass.localize(
"ui.panel.config.automation.editor.actions.type.device_id.action"
)}
></ha-device-action-picker>
${extraFieldsData
? html`
@ -125,7 +129,7 @@ export class HaDeviceAction extends LitElement {
// Returns a callback for ha-form to calculate labels per schema object
return (schema) =>
localize(
`ui.panel.config.automation.editor.actions.type.device.extra_fields.${schema.name}`
`ui.panel.config.automation.editor.actions.type.device_id.extra_fields.${schema.name}`
) || schema.name;
}
}

View File

@ -45,14 +45,18 @@ export class HaDeviceCondition extends LitElement {
.value=${deviceId}
@value-changed=${this._devicePicked}
.hass=${this.hass}
label="Device"
label=${this.hass.localize(
"ui.panel.config.automation.editor.conditions.type.device.label"
)}
></ha-device-picker>
<ha-device-condition-picker
.value=${this.condition}
.deviceId=${deviceId}
@value-changed=${this._deviceConditionPicked}
.hass=${this.hass}
label="Condition"
label=${this.hass.localize(
"ui.panel.config.automation.editor.conditions.type.device.condition"
)}
></ha-device-condition-picker>
${extraFieldsData
? html`

View File

@ -45,14 +45,18 @@ export class HaDeviceTrigger extends LitElement {
.value=${deviceId}
@value-changed=${this._devicePicked}
.hass=${this.hass}
label="Device"
label=${this.hass.localize(
"ui.panel.config.automation.editor.triggers.type.device.label"
)}
></ha-device-picker>
<ha-device-trigger-picker
.value=${this.trigger}
.deviceId=${deviceId}
@value-changed=${this._deviceTriggerPicked}
.hass=${this.hass}
label="Trigger"
label=${this.hass.localize(
"ui.panel.config.automation.editor.triggers.type.device.trigger"
)}
></ha-device-trigger-picker>
${extraFieldsData
? html`

View File

@ -781,6 +781,7 @@
"type": {
"device": {
"label": "Device",
"trigger": "Trigger",
"extra_fields": {
"above": "Above",
"below": "Below",
@ -875,6 +876,7 @@
},
"device": {
"label": "Device",
"condition": "Condition",
"extra_fields": {
"above": "Above",
"below": "Below",
@ -957,6 +959,7 @@
},
"device_id": {
"label": "Device",
"action": "Action",
"extra_fields": {
"code": "Code"
}