mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 11:46:42 +00:00
Fallback to raw config entry reason if localize returns an empty string (#20668)
Show config entry reason if localize returns an empty string
This commit is contained in:
parent
1bc33a30ec
commit
ec3f63e8a3
@ -557,18 +557,22 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
|
|||||||
if (item.error_reason_translation_key) {
|
if (item.error_reason_translation_key) {
|
||||||
const lokalisePromExc = this.hass
|
const lokalisePromExc = this.hass
|
||||||
.loadBackendTranslation("exceptions", item.domain)
|
.loadBackendTranslation("exceptions", item.domain)
|
||||||
.then((localize) =>
|
.then(
|
||||||
localize(
|
(localize) =>
|
||||||
`component.${item.domain}.exceptions.${item.error_reason_translation_key}.message`,
|
localize(
|
||||||
item.error_reason_translation_placeholders ?? undefined
|
`component.${item.domain}.exceptions.${item.error_reason_translation_key}.message`,
|
||||||
)
|
item.error_reason_translation_placeholders ?? undefined
|
||||||
|
) || item.reason
|
||||||
);
|
);
|
||||||
stateTextExtra = html`${until(lokalisePromExc)}`;
|
stateTextExtra = html`${until(lokalisePromExc)}`;
|
||||||
} else {
|
} else {
|
||||||
const lokalisePromError = this.hass
|
const lokalisePromError = this.hass
|
||||||
.loadBackendTranslation("config", item.domain)
|
.loadBackendTranslation("config", item.domain)
|
||||||
.then((localize) =>
|
.then(
|
||||||
localize(`component.${item.domain}.config.error.${item.reason}`)
|
(localize) =>
|
||||||
|
localize(
|
||||||
|
`component.${item.domain}.config.error.${item.reason}`
|
||||||
|
) || item.reason
|
||||||
);
|
);
|
||||||
stateTextExtra = html`${until(lokalisePromError, item.reason)}`;
|
stateTextExtra = html`${until(lokalisePromError, item.reason)}`;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user