Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/dialogs/config-flow/show-dialog-config-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,13 @@ export const showConfigFlowDialog = (
<ha-markdown allowsvg .content=${description}></ha-markdown>
`
: ""}
<p>Created config for ${step.title}.</p>
<p>
${hass.localize(
"ui.panel.config.integrations.config_flow.created_config",
"name",
step.title
)}
</p>
`;
},
});
12 changes: 10 additions & 2 deletions src/dialogs/config-flow/step-flow-abort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,20 @@ class StepFlowAbort extends LitElement {

protected render(): TemplateResult | void {
return html`
<h2>Aborted</h2>
<h2>
${this.hass.localize(
"ui.panel.config.integrations.config_flow.aborted"
)}
</h2>
<div class="content">
${this.flowConfig.renderAbortDescription(this.hass, this.step)}
</div>
<div class="buttons">
<mwc-button @click="${this._flowDone}">Close</mwc-button>
<mwc-button @click="${this._flowDone}"
>${this.hass.localize(
"ui.panel.config.integrations.config_flow.close"
)}</mwc-button
>
</div>
`;
}
Expand Down
36 changes: 30 additions & 6 deletions src/dialogs/config-flow/step-flow-create-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ class StepFlowCreateEntry extends LitElement {
${device.model} (${device.manufacturer})
</div>
<paper-dropdown-menu-light
label="Area"
label="${localize(
"ui.panel.config.integrations.config_flow.area_picker_label"
)}"
.device=${device.id}
@selected-item-changed=${this._handleAreaChanged}
>
Expand Down Expand Up @@ -91,11 +93,19 @@ class StepFlowCreateEntry extends LitElement {
<div class="buttons">
${this.devices.length > 0
? html`
<mwc-button @click="${this._addArea}">Add Area</mwc-button>
<mwc-button @click="${this._addArea}"
>${localize(
"ui.panel.config.integrations.config_flow.add_area"
)}</mwc-button
>
`
: ""}

<mwc-button @click="${this._flowDone}">Finish</mwc-button>
<mwc-button @click="${this._flowDone}"
>${localize(
"ui.panel.config.integrations.config_flow.finish"
)}</mwc-button
>
</div>
`;
}
Expand All @@ -105,7 +115,11 @@ class StepFlowCreateEntry extends LitElement {
}

private async _addArea() {
const name = prompt("Name of the new area?");
const name = prompt(
this.hass.localize(
"ui.panel.config.integrations.config_flow.name_new_area"
)
);
if (!name) {
return;
}
Expand All @@ -115,7 +129,11 @@ class StepFlowCreateEntry extends LitElement {
});
this.areas = [...this.areas, area];
} catch (err) {
alert("Failed to create area.");
alert(
this.hass.localize(
"ui.panel.config.integrations.config_flow.failed_create_area"
)
);
}
}

Expand All @@ -134,7 +152,13 @@ class StepFlowCreateEntry extends LitElement {
area_id: area,
});
} catch (err) {
alert(`Error saving area: ${err.message}`);
alert(
this.hass.localize(
"ui.panel.config.integrations.config_flow.error_saving_area",
"error",
"err.message"
)
);
dropdown.value = null;
}
}
Expand Down
11 changes: 7 additions & 4 deletions src/dialogs/config-flow/step-flow-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,17 @@ class StepFlowForm extends LitElement {
<mwc-button
@click=${this._submitStep}
.disabled=${!allRequiredInfoFilledIn}
>
Submit
>${this.hass.localize(
"ui.panel.config.integrations.config_flow.submit"
)}
</mwc-button>

${!allRequiredInfoFilledIn
? html`
<paper-tooltip position="left">
Not all required fields are filled in.
<paper-tooltip position="left"
>${this.hass.localize(
"ui.panel.config.integrations.config_flow.not_all_fields_required"
Comment thread
springstan marked this conversation as resolved.
Outdated
)}
</paper-tooltip>
`
: html``}
Expand Down
11 changes: 11 additions & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,17 @@
"no_area": "No Area"
},
"config_flow": {
"aborted": "Aborted",
"close": "Close",
"finish": "Finish",
"submit": "Submit",
"not_all_fields_required": "Not all required fields are filled in.",
Comment thread
springstan marked this conversation as resolved.
Outdated
"add_area": "Add Area",
"area_picker_label": "Area",
"failed_create_area": "Failed to create area.",
"error_saving_area": "Error saving area: {error}",
"name_new_area": "Name of the new area?",
"created_config": "Created config for {name}.",
"external_step": {
"description": "This step requires you to visit an external website to be completed.",
"open_site": "Open website"
Expand Down