Update where we load integration titles from (#5546)

This commit is contained in:
Paulus Schoutsen 2020-04-15 11:47:29 -07:00 committed by GitHub
parent fc7771ec13
commit ba0cba1a2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 17 additions and 22 deletions

View File

@ -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}
</a>
`;

View File

@ -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) => {

View File

@ -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
)}
</h2>
@ -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
)}
</p>

View File

@ -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`)
)
)
),

View File

@ -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,
};
});

View File

@ -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`

View File

@ -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",

View File

@ -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",

View File

@ -166,7 +166,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
return html`
${name}<br />
${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;

View File

@ -126,7 +126,7 @@ export class HaConfigManagerDashboard extends LitElement {
<paper-item>
<paper-item-body>
${this.hass.localize(
`component.${item.domain}.config.title`
`component.${item.domain}.title`
)}
</paper-item-body>
<paper-icon-button
@ -210,7 +210,7 @@ export class HaConfigManagerDashboard extends LitElement {
<paper-item-body two-line>
<div>
${this.hass.localize(
`component.${item.domain}.config.title`
`component.${item.domain}.title`
)}:
${item.title}
</div>
@ -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"