Fallback data flow label translation (#21704)

This commit is contained in:
Denis Shulyaka 2024-08-27 14:59:44 +03:00 committed by GitHub
parent 883ad58f52
commit 9482fcb04b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View File

@ -77,8 +77,10 @@ export const showConfigFlowDialog = (
},
renderShowFormStepFieldLabel(hass, step, field) {
return hass.localize(
`component.${step.handler}.config.step.${step.step_id}.data.${field.name}`
return (
hass.localize(
`component.${step.handler}.config.step.${step.step_id}.data.${field.name}`
) || field.name
);
},

View File

@ -94,8 +94,10 @@ export const showOptionsFlowDialog = (
},
renderShowFormStepFieldLabel(hass, step, field) {
return hass.localize(
`component.${configEntry.domain}.options.step.${step.step_id}.data.${field.name}`
return (
hass.localize(
`component.${configEntry.domain}.options.step.${step.step_id}.data.${field.name}`
) || field.name
);
},