diff --git a/homeassistant/components/binary_sensor/strings.json b/homeassistant/components/binary_sensor/strings.json index 62a73036238..62ff8187731 100644 --- a/homeassistant/components/binary_sensor/strings.json +++ b/homeassistant/components/binary_sensor/strings.json @@ -115,9 +115,9 @@ "off": "Not charging", "on": "Charging" }, - "co": { - "off": "Clear", - "on": "Detected" + "carbon_monoxide": { + "off": "[%key:component::binary_sensor::state::gas::off%]", + "on": "[%key:component::binary_sensor::state::gas::on%]" }, "cold": { "off": "[%key:component::binary_sensor::state::battery::off%]", diff --git a/homeassistant/components/binary_sensor/translations/en.json b/homeassistant/components/binary_sensor/translations/en.json index fd69ab678a7..1dc6cf2caa1 100644 --- a/homeassistant/components/binary_sensor/translations/en.json +++ b/homeassistant/components/binary_sensor/translations/en.json @@ -59,8 +59,6 @@ "connected": "{entity_name} connected", "gas": "{entity_name} started detecting gas", "hot": "{entity_name} became hot", - "is_not_tampered": "{entity_name} stopped detecting tampering", - "is_tampered": "{entity_name} started detecting tampering", "light": "{entity_name} started detecting light", "locked": "{entity_name} locked", "moist": "{entity_name} became moist", @@ -134,7 +132,7 @@ "off": "Not charging", "on": "Charging" }, - "co": { + "carbon_monoxide": { "off": "Clear", "on": "Detected" }, diff --git a/script/translations/develop.py b/script/translations/develop.py index f59b9b9c7cb..2f9966afc29 100644 --- a/script/translations/develop.py +++ b/script/translations/develop.py @@ -75,7 +75,13 @@ def substitute_reference(value, flattened_translations): new = value for key in matches: if key in flattened_translations: - new = new.replace(f"[%key:{key}%]", flattened_translations[key]) + new = new.replace( + f"[%key:{key}%]", + # New value can also be a substitution reference + substitute_reference( + flattened_translations[key], flattened_translations + ), + ) else: print(f"Invalid substitution key '{key}' found in string '{value}'") sys.exit(1)