mirror of
https://github.com/home-assistant/core.git
synced 2026-04-17 15:44:52 +01:00
Repair flow description placeholders are optional (#159385)
This commit is contained in:
@@ -811,6 +811,7 @@ async def _check_config_flow_result_translations(
|
||||
return
|
||||
|
||||
key_prefix = ""
|
||||
description_placeholders = result.get("description_placeholders")
|
||||
if isinstance(manager, ConfigEntriesFlowManager):
|
||||
category = "config"
|
||||
integration = flow.handler
|
||||
@@ -823,6 +824,12 @@ async def _check_config_flow_result_translations(
|
||||
issue_id = flow.issue_id
|
||||
issue = ir.async_get(flow.hass).async_get_issue(integration, issue_id)
|
||||
key_prefix = f"{issue.translation_key}.fix_flow."
|
||||
description_placeholders = {
|
||||
# Both are used in issue translations, and description_placeholders
|
||||
# takes precedence over translation_placeholders
|
||||
**(issue.translation_placeholders or {}),
|
||||
**(description_placeholders or {}),
|
||||
}
|
||||
else:
|
||||
return
|
||||
|
||||
@@ -838,7 +845,7 @@ async def _check_config_flow_result_translations(
|
||||
category,
|
||||
integration,
|
||||
f"{key_prefix}step.{step_id}",
|
||||
result["description_placeholders"],
|
||||
description_placeholders,
|
||||
result["data_schema"],
|
||||
ignore_translations_for_mock_domains,
|
||||
)
|
||||
@@ -852,7 +859,7 @@ async def _check_config_flow_result_translations(
|
||||
category,
|
||||
integration,
|
||||
f"{key_prefix}error.{error}",
|
||||
result["description_placeholders"],
|
||||
description_placeholders,
|
||||
)
|
||||
return
|
||||
|
||||
@@ -868,7 +875,7 @@ async def _check_config_flow_result_translations(
|
||||
category,
|
||||
integration,
|
||||
f"{key_prefix}abort.{result['reason']}",
|
||||
result["description_placeholders"],
|
||||
description_placeholders,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user