From ba0cba1a2b013d9cb7196f6203b4bd6d8f6d475c Mon Sep 17 00:00:00 2001
From: Paulus Schoutsen
Date: Wed, 15 Apr 2020 11:47:29 -0700
Subject: [PATCH] Update where we load integration titles from (#5546)
---
src/components/ha-related-items.ts | 2 +-
src/data/config_flow.ts | 2 +-
.../dialog-config-entry-system-options.ts | 4 ++--
src/dialogs/config-flow/show-dialog-config-flow.ts | 4 ++--
src/dialogs/config-flow/step-flow-pick-handler.ts | 3 +--
src/onboarding/onboarding-integrations.ts | 4 +---
src/panels/config/devices/ha-config-devices-dashboard.ts | 5 ++---
src/panels/config/devices/ha-devices-data-table.ts | 5 ++---
src/panels/config/entities/ha-config-entities.ts | 4 ++--
.../config/integrations/ha-config-entries-dashboard.ts | 6 +++---
10 files changed, 17 insertions(+), 22 deletions(-)
diff --git a/src/components/ha-related-items.ts b/src/components/ha-related-items.ts
index 124c93404e..6077f0c284 100644
--- a/src/components/ha-related-items.ts
+++ b/src/components/ha-related-items.ts
@@ -98,7 +98,7 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
href="/config/integrations/config_entry/${relatedConfigEntryId}"
@click=${this._close}
>
- ${this.hass.localize(`component.${entry.domain}.config.title`)}:
+ ${this.hass.localize(`component.${entry.domain}.title`)}:
${entry.title}
`;
diff --git a/src/data/config_flow.ts b/src/data/config_flow.ts
index 268e3e04ae..288803a715 100644
--- a/src/data/config_flow.ts
+++ b/src/data/config_flow.ts
@@ -75,7 +75,7 @@ export const localizeConfigFlowTitle = (
const placeholders = flow.context.title_placeholders || {};
const placeholderKeys = Object.keys(placeholders);
if (placeholderKeys.length === 0) {
- return localize(`component.${flow.handler}.config.title`);
+ return localize(`component.${flow.handler}.title`);
}
const args: string[] = [];
placeholderKeys.forEach((key) => {
diff --git a/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts b/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts
index bd4270ca67..5ee5bfd538 100644
--- a/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts
+++ b/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts
@@ -66,7 +66,7 @@ class DialogConfigEntrySystemOptions extends LitElement {
"ui.dialogs.config_entry_system_options.title",
"integration",
this.hass.localize(
- `component.${this._params.entry.domain}.config.title`
+ `component.${this._params.entry.domain}.title`
) || this._params.entry.domain
)}
@@ -98,7 +98,7 @@ class DialogConfigEntrySystemOptions extends LitElement {
"ui.dialogs.config_entry_system_options.enable_new_entities_description",
"integration",
this.hass.localize(
- `component.${this._params.entry.domain}.config.title`
+ `component.${this._params.entry.domain}.title`
) || this._params.entry.domain
)}
diff --git a/src/dialogs/config-flow/show-dialog-config-flow.ts b/src/dialogs/config-flow/show-dialog-config-flow.ts
index 5a044a2239..0a2d6341e2 100644
--- a/src/dialogs/config-flow/show-dialog-config-flow.ts
+++ b/src/dialogs/config-flow/show-dialog-config-flow.ts
@@ -26,8 +26,8 @@ export const showConfigFlowDialog = (
getConfigFlowHandlers(hass).then((handlers) =>
handlers.sort((handlerA, handlerB) =>
caseInsensitiveCompare(
- hass.localize(`component.${handlerA}.config.title`),
- hass.localize(`component.${handlerB}.config.title`)
+ hass.localize(`component.${handlerA}.title`),
+ hass.localize(`component.${handlerB}.title`)
)
)
),
diff --git a/src/dialogs/config-flow/step-flow-pick-handler.ts b/src/dialogs/config-flow/step-flow-pick-handler.ts
index c6bee2c316..804732b78a 100644
--- a/src/dialogs/config-flow/step-flow-pick-handler.ts
+++ b/src/dialogs/config-flow/step-flow-pick-handler.ts
@@ -43,8 +43,7 @@ class StepFlowPickHandler extends LitElement {
private _getHandlers = memoizeOne((h: string[], filter?: string) => {
const handlers: HandlerObj[] = h.map((handler) => {
return {
- name:
- this.hass.localize(`component.${handler}.config.title`) || handler,
+ name: this.hass.localize(`component.${handler}.title`) || handler,
slug: handler,
};
});
diff --git a/src/onboarding/onboarding-integrations.ts b/src/onboarding/onboarding-integrations.ts
index 4ee2639e55..74a2d2da65 100644
--- a/src/onboarding/onboarding-integrations.ts
+++ b/src/onboarding/onboarding-integrations.ts
@@ -62,9 +62,7 @@ class OnboardingIntegrations extends LitElement {
// Render discovered and existing entries together sorted by localized title.
const entries: Array<[string, TemplateResult]> = this._entries.map(
(entry) => {
- const title = this.hass.localize(
- `component.${entry.domain}.config.title`
- );
+ const title = this.hass.localize(`component.${entry.domain}.title`);
return [
title,
html`
diff --git a/src/panels/config/devices/ha-config-devices-dashboard.ts b/src/panels/config/devices/ha-config-devices-dashboard.ts
index 885873e253..a89a036a77 100644
--- a/src/panels/config/devices/ha-config-devices-dashboard.ts
+++ b/src/panels/config/devices/ha-config-devices-dashboard.ts
@@ -115,9 +115,8 @@ export class HaConfigDeviceDashboard extends LitElement {
.filter((entId) => entId in entryLookup)
.map(
(entId) =>
- localize(
- `component.${entryLookup[entId].domain}.config.title`
- ) || entryLookup[entId].domain
+ localize(`component.${entryLookup[entId].domain}.title`) ||
+ entryLookup[entId].domain
)
.join(", ")
: "No integration",
diff --git a/src/panels/config/devices/ha-devices-data-table.ts b/src/panels/config/devices/ha-devices-data-table.ts
index e0ab9b78b8..cbe8cd7e69 100644
--- a/src/panels/config/devices/ha-devices-data-table.ts
+++ b/src/panels/config/devices/ha-devices-data-table.ts
@@ -116,9 +116,8 @@ export class HaDevicesDataTable extends LitElement {
.filter((entId) => entId in entryLookup)
.map(
(entId) =>
- localize(
- `component.${entryLookup[entId].domain}.config.title`
- ) || entryLookup[entId].domain
+ localize(`component.${entryLookup[entId].domain}.title`) ||
+ entryLookup[entId].domain
)
.join(", ")
: "No integration",
diff --git a/src/panels/config/entities/ha-config-entities.ts b/src/panels/config/entities/ha-config-entities.ts
index f9c793bb8b..75fcdfe1f6 100644
--- a/src/panels/config/entities/ha-config-entities.ts
+++ b/src/panels/config/entities/ha-config-entities.ts
@@ -166,7 +166,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
return html`
${name}
${entity.entity_id} |
- ${this.hass.localize(`component.${entity.platform}.config.title`) ||
+ ${this.hass.localize(`component.${entity.platform}.title`) ||
entity.platform}
`;
};
@@ -190,7 +190,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
filterable: true,
width: "20%",
template: (platform) =>
- this.hass.localize(`component.${platform}.config.title`) || platform,
+ this.hass.localize(`component.${platform}.title`) || platform,
};
columns.status = statusColumn;
diff --git a/src/panels/config/integrations/ha-config-entries-dashboard.ts b/src/panels/config/integrations/ha-config-entries-dashboard.ts
index 2d1efda9c7..2fac604f49 100644
--- a/src/panels/config/integrations/ha-config-entries-dashboard.ts
+++ b/src/panels/config/integrations/ha-config-entries-dashboard.ts
@@ -126,7 +126,7 @@ export class HaConfigManagerDashboard extends LitElement {
${this.hass.localize(
- `component.${item.domain}.config.title`
+ `component.${item.domain}.title`
)}
${this.hass.localize(
- `component.${item.domain}.config.title`
+ `component.${item.domain}.title`
)}:
${item.title}
@@ -311,7 +311,7 @@ export class HaConfigManagerDashboard extends LitElement {
title: this.hass!.localize(
"ui.panel.config.integrations.ignore.confirm_delete_ignore_title",
"name",
- this.hass.localize(`component.${entry.domain}.config.title`)
+ this.hass.localize(`component.${entry.domain}.title`)
),
text: this.hass!.localize(
"ui.panel.config.integrations.ignore.confirm_delete_ignore"