mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Make thingtalk dialogs translatable (#7574)
This commit is contained in:
parent
028ae061da
commit
0037cd2e69
@ -85,13 +85,22 @@ class DialogThingtalk extends LitElement {
|
|||||||
.opened=${this._opened}
|
.opened=${this._opened}
|
||||||
@opened-changed=${this._openedChanged}
|
@opened-changed=${this._openedChanged}
|
||||||
>
|
>
|
||||||
<h2>Create a new automation</h2>
|
<h2>
|
||||||
|
${this.hass.localize(
|
||||||
|
`ui.panel.config.automation.thingtalk.task_selection.header`
|
||||||
|
)}
|
||||||
|
</h2>
|
||||||
<paper-dialog-scrollable>
|
<paper-dialog-scrollable>
|
||||||
${this._error ? html` <div class="error">${this._error}</div> ` : ""}
|
${this._error ? html` <div class="error">${this._error}</div> ` : ""}
|
||||||
Type below what this automation should do, and we will try to convert
|
${this.hass.localize(
|
||||||
it into a Home Assistant automation. (only English is supported for
|
`ui.panel.config.automation.thingtalk.task_selection.introduction`
|
||||||
now)<br /><br />
|
)}<br /><br />
|
||||||
For example:
|
${this.hass.localize(
|
||||||
|
`ui.panel.config.automation.thingtalk.task_selection.language_note`
|
||||||
|
)}<br /><br />
|
||||||
|
${this.hass.localize(
|
||||||
|
`ui.panel.config.automation.thingtalk.task_selection.for_example`
|
||||||
|
)}
|
||||||
<ul @click=${this._handleExampleClick}>
|
<ul @click=${this._handleExampleClick}>
|
||||||
<li>
|
<li>
|
||||||
<button class="link">
|
<button class="link">
|
||||||
@ -130,7 +139,7 @@ class DialogThingtalk extends LitElement {
|
|||||||
</paper-dialog-scrollable>
|
</paper-dialog-scrollable>
|
||||||
<div class="paper-dialog-buttons">
|
<div class="paper-dialog-buttons">
|
||||||
<mwc-button class="left" @click="${this._skip}">
|
<mwc-button class="left" @click="${this._skip}">
|
||||||
Skip
|
${this.hass.localize(`ui.common.skip`)}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
<mwc-button @click="${this._generate}" .disabled=${this._submitting}>
|
<mwc-button @click="${this._generate}" .disabled=${this._submitting}>
|
||||||
${this._submitting
|
${this._submitting
|
||||||
@ -140,7 +149,7 @@ class DialogThingtalk extends LitElement {
|
|||||||
title="Creating your automation..."
|
title="Creating your automation..."
|
||||||
></ha-circular-progress>`
|
></ha-circular-progress>`
|
||||||
: ""}
|
: ""}
|
||||||
Create automation
|
${this.hass.localize(`ui.panel.config.automation.thingtalk.create`)}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
</div>
|
</div>
|
||||||
</ha-paper-dialog>
|
</ha-paper-dialog>
|
||||||
@ -150,7 +159,9 @@ class DialogThingtalk extends LitElement {
|
|||||||
private async _generate() {
|
private async _generate() {
|
||||||
this._value = this._input!.value as string;
|
this._value = this._input!.value as string;
|
||||||
if (!this._value) {
|
if (!this._value) {
|
||||||
this._error = "Enter a command or tap skip.";
|
this._error = this.hass.localize(
|
||||||
|
`ui.panel.config.automation.thingtalk.task_selection.error_empty`
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this._submitting = true;
|
this._submitting = true;
|
||||||
@ -169,7 +180,9 @@ class DialogThingtalk extends LitElement {
|
|||||||
this._submitting = false;
|
this._submitting = false;
|
||||||
|
|
||||||
if (!Object.keys(config).length) {
|
if (!Object.keys(config).length) {
|
||||||
this._error = "We couldn't create an automation for that (yet?).";
|
this._error = this.hass.localize(
|
||||||
|
`ui.panel.config.automation.thingtalk.task_selection.error_unsupported`
|
||||||
|
);
|
||||||
} else if (Object.keys(placeholders).length) {
|
} else if (Object.keys(placeholders).length) {
|
||||||
this._config = config;
|
this._config = config;
|
||||||
this._placeholders = placeholders;
|
this._placeholders = placeholders;
|
||||||
|
@ -131,7 +131,11 @@ export class ThingTalkPlaceholders extends SubscribeMixin(LitElement) {
|
|||||||
.opened=${this.opened}
|
.opened=${this.opened}
|
||||||
@opened-changed="${this._openedChanged}"
|
@opened-changed="${this._openedChanged}"
|
||||||
>
|
>
|
||||||
<h2>Great! Now we need to link some devices.</h2>
|
<h2>
|
||||||
|
${this.hass.localize(
|
||||||
|
`ui.panel.config.automation.thingtalk.link_devices.header`
|
||||||
|
)}
|
||||||
|
</h2>
|
||||||
<paper-dialog-scrollable>
|
<paper-dialog-scrollable>
|
||||||
${this._error ? html` <div class="error">${this._error}</div> ` : ""}
|
${this._error ? html` <div class="error">${this._error}</div> ` : ""}
|
||||||
${Object.entries(this.placeholders).map(
|
${Object.entries(this.placeholders).map(
|
||||||
@ -168,8 +172,9 @@ export class ThingTalkPlaceholders extends SubscribeMixin(LitElement) {
|
|||||||
${extraInfo && extraInfo.manualEntity
|
${extraInfo && extraInfo.manualEntity
|
||||||
? html`
|
? html`
|
||||||
<h3>
|
<h3>
|
||||||
One or more devices have more than one matching
|
${this.hass.localize(
|
||||||
entity, please pick the one you want to use.
|
`ui.panel.config.automation.thingtalk.link_devices.ambiguous_entities`
|
||||||
|
)}
|
||||||
</h3>
|
</h3>
|
||||||
${Object.keys(extraInfo.manualEntity).map(
|
${Object.keys(extraInfo.manualEntity).map(
|
||||||
(idx) => html`
|
(idx) => html`
|
||||||
@ -226,7 +231,9 @@ export class ThingTalkPlaceholders extends SubscribeMixin(LitElement) {
|
|||||||
}
|
}
|
||||||
return html`
|
return html`
|
||||||
<div class="error">
|
<div class="error">
|
||||||
Unknown placeholder<br />
|
${this.hass.localize(
|
||||||
|
`ui.panel.config.automation.thingtalk.link_devices.unknown_placeholder`
|
||||||
|
)}<br />
|
||||||
${placeholder.domains}<br />
|
${placeholder.domains}<br />
|
||||||
${placeholder.fields.map(
|
${placeholder.fields.map(
|
||||||
(field) => html` ${field}<br /> `
|
(field) => html` ${field}<br /> `
|
||||||
@ -239,10 +246,10 @@ export class ThingTalkPlaceholders extends SubscribeMixin(LitElement) {
|
|||||||
</paper-dialog-scrollable>
|
</paper-dialog-scrollable>
|
||||||
<div class="paper-dialog-buttons">
|
<div class="paper-dialog-buttons">
|
||||||
<mwc-button class="left" @click="${this.skip}">
|
<mwc-button class="left" @click="${this.skip}">
|
||||||
Skip
|
${this.hass.localize(`ui.common.skip`)}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
<mwc-button @click="${this._done}" .disabled=${!this._isDone}>
|
<mwc-button @click="${this._done}" .disabled=${!this._isDone}>
|
||||||
Create automation
|
${this.hass.localize(`ui.panel.config.automation.thingtalk.create`)}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
</div>
|
</div>
|
||||||
</ha-paper-dialog>
|
</ha-paper-dialog>
|
||||||
|
@ -275,6 +275,7 @@
|
|||||||
"save": "Save",
|
"save": "Save",
|
||||||
"yes": "Yes",
|
"yes": "Yes",
|
||||||
"no": "No",
|
"no": "No",
|
||||||
|
"skip": "Skip",
|
||||||
"menu": "Menu",
|
"menu": "Menu",
|
||||||
"overflow_menu": "Overflow menu",
|
"overflow_menu": "Overflow menu",
|
||||||
"successfully_saved": "Successfully saved",
|
"successfully_saved": "Successfully saved",
|
||||||
@ -1119,7 +1120,7 @@
|
|||||||
"event_data": "Event data",
|
"event_data": "Event data",
|
||||||
"context_users": "Limit to events triggered by",
|
"context_users": "Limit to events triggered by",
|
||||||
"context_user_picked": "User firing event",
|
"context_user_picked": "User firing event",
|
||||||
"context_user_pick": "Add user"
|
"context_user_pick": "Select user"
|
||||||
},
|
},
|
||||||
"geo_location": {
|
"geo_location": {
|
||||||
"label": "Geolocation",
|
"label": "Geolocation",
|
||||||
@ -1347,6 +1348,22 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"thingtalk": {
|
||||||
|
"create": "Create automation",
|
||||||
|
"task_selection": {
|
||||||
|
"header": "Create a new automation",
|
||||||
|
"introduction": "Type below what this automation should do, and we will try to convert it into a Home Assistant automation.",
|
||||||
|
"language_note": "Note: Only English is supported for now.",
|
||||||
|
"for_example": "For example:",
|
||||||
|
"error_empty": "Enter a command or tap skip.",
|
||||||
|
"error_unsupported": "We couldn't create an automation for that (yet?)."
|
||||||
|
},
|
||||||
|
"link_devices": {
|
||||||
|
"header": "Great! Now we need to link some devices",
|
||||||
|
"ambiguous_entities": "One or more devices have more than one matching entity, please pick the one you want to use.",
|
||||||
|
"unknown_placeholder": "Unknown placeholder"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"script": {
|
"script": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user