mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
Extend usage of Data Entry Flow forms description_placeholders to field labels (#25115)
This commit is contained in:
parent
8e778cfc32
commit
11b8f6210f
@ -81,7 +81,8 @@ export const showConfigFlowDialog = (
|
||||
renderShowFormStepFieldLabel(hass, step, field, options) {
|
||||
if (field.type === "expandable") {
|
||||
return hass.localize(
|
||||
`component.${step.handler}.config.step.${step.step_id}.sections.${field.name}.name`
|
||||
`component.${step.handler}.config.step.${step.step_id}.sections.${field.name}.name`,
|
||||
step.description_placeholders
|
||||
);
|
||||
}
|
||||
|
||||
@ -89,7 +90,8 @@ export const showConfigFlowDialog = (
|
||||
|
||||
return (
|
||||
hass.localize(
|
||||
`component.${step.handler}.config.step.${step.step_id}.${prefix}data.${field.name}`
|
||||
`component.${step.handler}.config.step.${step.step_id}.${prefix}data.${field.name}`,
|
||||
step.description_placeholders
|
||||
) || field.name
|
||||
);
|
||||
},
|
||||
@ -97,7 +99,8 @@ export const showConfigFlowDialog = (
|
||||
renderShowFormStepFieldHelper(hass, step, field, options) {
|
||||
if (field.type === "expandable") {
|
||||
return hass.localize(
|
||||
`component.${step.translation_domain || step.handler}.config.step.${step.step_id}.sections.${field.name}.description`
|
||||
`component.${step.translation_domain || step.handler}.config.step.${step.step_id}.sections.${field.name}.description`,
|
||||
step.description_placeholders
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,8 @@ export const showOptionsFlowDialog = (
|
||||
renderShowFormStepFieldLabel(hass, step, field, options) {
|
||||
if (field.type === "expandable") {
|
||||
return hass.localize(
|
||||
`component.${configEntry.domain}.options.step.${step.step_id}.sections.${field.name}.name`
|
||||
`component.${configEntry.domain}.options.step.${step.step_id}.sections.${field.name}.name`,
|
||||
step.description_placeholders
|
||||
);
|
||||
}
|
||||
|
||||
@ -104,7 +105,8 @@ export const showOptionsFlowDialog = (
|
||||
|
||||
return (
|
||||
hass.localize(
|
||||
`component.${configEntry.domain}.options.step.${step.step_id}.${prefix}data.${field.name}`
|
||||
`component.${configEntry.domain}.options.step.${step.step_id}.${prefix}data.${field.name}`,
|
||||
step.description_placeholders
|
||||
) || field.name
|
||||
);
|
||||
},
|
||||
@ -112,7 +114,8 @@ export const showOptionsFlowDialog = (
|
||||
renderShowFormStepFieldHelper(hass, step, field, options) {
|
||||
if (field.type === "expandable") {
|
||||
return hass.localize(
|
||||
`component.${step.translation_domain || configEntry.domain}.options.step.${step.step_id}.sections.${field.name}.description`
|
||||
`component.${step.translation_domain || configEntry.domain}.options.step.${step.step_id}.sections.${field.name}.description`,
|
||||
step.description_placeholders
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,8 @@ export const showSubConfigFlowDialog = (
|
||||
renderShowFormStepFieldLabel(hass, step, field, options) {
|
||||
if (field.type === "expandable") {
|
||||
return hass.localize(
|
||||
`component.${configEntry.domain}.config_subentries.${flowType}.step.${step.step_id}.sections.${field.name}.name`
|
||||
`component.${configEntry.domain}.config_subentries.${flowType}.step.${step.step_id}.sections.${field.name}.name`,
|
||||
step.description_placeholders
|
||||
);
|
||||
}
|
||||
|
||||
@ -95,7 +96,8 @@ export const showSubConfigFlowDialog = (
|
||||
|
||||
return (
|
||||
hass.localize(
|
||||
`component.${configEntry.domain}.config_subentries.${flowType}.step.${step.step_id}.${prefix}data.${field.name}`
|
||||
`component.${configEntry.domain}.config_subentries.${flowType}.step.${step.step_id}.${prefix}data.${field.name}`,
|
||||
step.description_placeholders
|
||||
) || field.name
|
||||
);
|
||||
},
|
||||
@ -103,7 +105,8 @@ export const showSubConfigFlowDialog = (
|
||||
renderShowFormStepFieldHelper(hass, step, field, options) {
|
||||
if (field.type === "expandable") {
|
||||
return hass.localize(
|
||||
`component.${step.translation_domain || configEntry.domain}.config_subentries.${flowType}.step.${step.step_id}.sections.${field.name}.description`
|
||||
`component.${step.translation_domain || configEntry.domain}.config_subentries.${flowType}.step.${step.step_id}.sections.${field.name}.description`,
|
||||
step.description_placeholders
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user