mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Allow placeholders for config flow description (#1274)
This commit is contained in:
parent
0b6214be2b
commit
9717166fee
@ -49,7 +49,7 @@ class HaConfigFlow extends
|
||||
</template>
|
||||
<template is="dom-if" if="[[step]]">
|
||||
<template is="dom-if" if="[[_equals(step.type, "abort")]]">
|
||||
<p>[[_computeStepAbortedReason(localize, step)]]</p>
|
||||
<ha-markdown content="[[_computeStepAbortedReason(localize, step)]]"></ha-markdown>
|
||||
</template>
|
||||
|
||||
<template is="dom-if" if="[[_equals(step.type, "create_entry")]]">
|
||||
@ -178,7 +178,13 @@ class HaConfigFlow extends
|
||||
}
|
||||
|
||||
_computeStepDescription(localize, step) {
|
||||
return localize(`component.${step.handler}.config.step.${step.step_id}.description`);
|
||||
const args = [`component.${step.handler}.config.step.${step.step_id}.description`];
|
||||
const placeholders = step.description_placeholders || {};
|
||||
Object.keys(placeholders).forEach((key) => {
|
||||
args.push(key);
|
||||
args.push(placeholders[key]);
|
||||
});
|
||||
return localize(...args);
|
||||
}
|
||||
|
||||
_computeLabelCallback(localize, step) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user