Translated unused entities, device registry page and domain toggler dialog (#4141)

* Translated device registry and domain toggler dialog

* Translated unused entities page

* Extracted unused_entities keys and created new section for domain_toggler

* Moved unknow_error and area_picker_label into devices section
This commit is contained in:
springstan 2019-11-01 16:07:18 +01:00 committed by Bram Kragten
parent 46f5224e70
commit 0fa8db1682
5 changed files with 52 additions and 18 deletions

View File

@ -74,7 +74,10 @@ class DialogDeviceRegistryDetail extends LitElement {
opened
@opened-changed="${this._openedChanged}"
>
<h2>${device.name || "Unnamed device"}</h2>
<h2>
${device.name ||
this.hass.localize("ui.panel.config.devices.unnamed_device")}
</h2>
<paper-dialog-scrollable>
${this._error
? html`
@ -90,7 +93,12 @@ class DialogDeviceRegistryDetail extends LitElement {
.disabled=${this._submitting}
></paper-input>
<div class="area">
<paper-dropdown-menu label="Area" class="flex">
<paper-dropdown-menu
label="${this.hass.localize(
"ui.panel.config.devices.area_picker_label"
)}"
class="flex"
>
<paper-listbox
slot="dropdown-content"
.selected="${this._computeSelectedArea()}"
@ -163,7 +171,9 @@ class DialogDeviceRegistryDetail extends LitElement {
});
this._params = undefined;
} catch (err) {
this._error = err.message || "Unknown error";
this._error =
err.message ||
this.hass.localize("ui.panel.config.devices.unknown_error");
} finally {
this._submitting = false;
}

View File

@ -37,7 +37,9 @@ class DomainTogglerDialog extends LitElement {
opened
@opened-changed=${this._openedChanged}
>
<h2>Toggle Domains</h2>
<h2>
${this.hass.localize("ui.dialogs.domain_toggler.title")}
</h2>
<div>
${domains.map(
(domain) =>

View File

@ -57,7 +57,7 @@ export class HuiUnusedEntities extends LitElement {
private _columns = memoizeOne((narrow: boolean) => {
const columns: DataTableColumnContainer = {
entity: {
title: "Entity",
title: this.hass!.localize("ui.panel.lovelace.unused_entities.entity"),
sortable: true,
filterable: true,
filterKey: "friendly_name",
@ -79,17 +79,19 @@ export class HuiUnusedEntities extends LitElement {
}
columns.entity_id = {
title: "Entity id",
title: this.hass!.localize("ui.panel.lovelace.unused_entities.entity_id"),
sortable: true,
filterable: true,
};
columns.domain = {
title: "Domain",
title: this.hass!.localize("ui.panel.lovelace.unused_entities.domain"),
sortable: true,
filterable: true,
};
columns.last_changed = {
title: "Last Changed",
title: this.hass!.localize(
"ui.panel.lovelace.unused_entities.last_changed"
),
type: "numeric",
sortable: true,
template: (lastChanged: string) => html`
@ -121,14 +123,20 @@ export class HuiUnusedEntities extends LitElement {
}
return html`
<ha-card header="Unused entities">
<ha-card
header="${this.hass.localize(
"ui.panel.lovelace.unused_entities.title"
)}"
>
<div class="card-content">
These are the entities that you have available, but are not in your
Lovelace UI yet.
${this.hass.localize(
"ui.panel.lovelace.unused_entities.available_entities"
)}
${this.lovelace.mode === "storage"
? html`
<br />Select the entities you want to add to a card and then
click the add card button.
<br />${this.hass.localize(
"ui.panel.lovelace.unused_entities.select_to_add"
)}
`
: ""}
</div>

View File

@ -142,12 +142,12 @@ class HUIRoot extends LitElement {
: html`
<paper-item
aria-label=${this.hass!.localize(
"ui.panel.lovelace.menu.unused_entities"
"ui.panel.lovelace.unused_entities.title"
)}
@tap="${this._handleUnusedEntities}"
>
${this.hass!.localize(
"ui.panel.lovelace.menu.unused_entities"
"ui.panel.lovelace.unused_entities.title"
)}
</paper-item>
`}
@ -203,12 +203,12 @@ class HUIRoot extends LitElement {
</paper-item>
<paper-item
aria-label=${this.hass!.localize(
"ui.panel.lovelace.menu.unused_entities"
"ui.panel.lovelace.unused_entities.title"
)}
@tap="${this._handleUnusedEntities}"
>
${this.hass!.localize(
"ui.panel.lovelace.menu.unused_entities"
"ui.panel.lovelace.unused_entities.title"
)}
</paper-item>
`

View File

@ -618,6 +618,9 @@
"area_picker_label": "Area",
"update_name_button": "Update Name"
}
},
"domain_toggler": {
"title": "Toggle Domains"
}
},
"duration": {
@ -1141,6 +1144,9 @@
"devices": {
"caption": "Devices",
"description": "Manage connected devices",
"unnamed_device": "Unnamed device",
"unknown_error": "Unknown error",
"area_picker_label": "Area",
"automation": {
"triggers": {
"caption": "Do something when..."
@ -1408,13 +1414,21 @@
"more_info": "Show more-info: {name}"
}
},
"unused_entities": {
"title": "Unused entities",
"available_entities": "These are the entities that you have available, but are not in your Lovelace UI yet.",
"select_to_add": "Select the entities you want to add to a card and then click the add card button.",
"entity": "Entity",
"entity_id": "Entity ID",
"domain": "Domain",
"last_changed": "Last Changed"
},
"views": {
"confirm_delete": "Are you sure you want to delete this view?",
"existing_cards": "You can't delete a view that has cards in it. Remove the cards first."
},
"menu": {
"configure_ui": "Configure UI",
"unused_entities": "Unused entities",
"help": "Help",
"refresh": "Refresh",
"close": "Close"