Allow for translating service examples (#97141)

This commit is contained in:
Franck Nijhof
2023-07-24 15:57:02 +02:00
committed by GitHub
parent 0c4e341189
commit b655b9d530
3 changed files with 10 additions and 0 deletions

View File

@@ -666,6 +666,10 @@ async def async_get_all_descriptions(
f"component.{domain}.services.{service_name}.fields.{field_name}.description"
):
field_schema["description"] = desc
if example := translations.get(
f"component.{domain}.services.{service_name}.fields.{field_name}.example"
):
field_schema["example"] = example
if "target" in yaml_description:
description["target"] = yaml_description["target"]