Resolve runtime translation references

This commit is contained in:
Hmmbob committed 2026-07-24 21:13:07 +02:00
1 parent 82acc05d38
commit 5d86dbe7e8
3 files changed
+106 -88

No files matched your search

@@ -20,7 +20,7 @@
"name": "Current limit enabled" "name": "Current limit enabled"
}, },
"cycle_active": { "cycle_active": {
"name": "[%key:component::binary_sensor::entity_component::running::name%]" "name": "Running"
}, },
"defrost_active": { "defrost_active": {
"name": "Defrost active" "name": "Defrost active"
@@ -32,7 +32,7 @@
"name": "Device active" "name": "Device active"
}, },
"door_open": { "door_open": {
"name": "[%key:component::binary_sensor::entity_component::door::name%]" "name": "Door"
}, },
"firmware_update": { "firmware_update": {
"name": "Firmware update available" "name": "Firmware update available"
@@ -73,16 +73,16 @@
"name": "Start diagnosis" "name": "Start diagnosis"
}, },
"pause": { "pause": {
"name": "[%key:common::action::pause%]" "name": "Pause"
}, },
"selfcheck_start": { "selfcheck_start": {
"name": "Start self-check" "name": "Start self-check"
}, },
"start": { "start": {
"name": "[%key:common::action::start%]" "name": "Start"
}, },
"stop": { "stop": {
"name": "[%key:common::action::stop%]" "name": "Stop"
} }
}, },
"climate": { "climate": {
@@ -134,24 +134,24 @@
"brightness_level": { "brightness_level": {
"name": "Night brightness", "name": "Night brightness",
"state": { "state": {
"33": "[%key:common::state::low%]", "33": "Low",
"66": "[%key:common::state::medium%]", "66": "Medium",
"100": "[%key:common::state::high%]" "100": "High"
} }
}, },
"day_brightness": { "day_brightness": {
"name": "Cabinet brightness", "name": "Cabinet brightness",
"state": { "state": {
"33": "[%key:common::state::low%]", "33": "Low",
"66": "[%key:common::state::medium%]", "66": "Medium",
"100": "[%key:common::state::high%]" "100": "High"
} }
}, },
"buzzer_sound": { "buzzer_sound": {
"name": "Buzzer sound", "name": "Buzzer sound",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "Off",
"on": "[%key:common::state::on%]" "on": "On"
} }
}, },
"cycle": { "cycle": {
@@ -161,16 +161,16 @@
"name": "Detergent quantity", "name": "Detergent quantity",
"state": { "state": {
"00": "None", "00": "None",
"01": "[%key:common::state::low%]", "01": "Low",
"02": "[%key:common::state::medium%]", "02": "Medium",
"03": "[%key:common::state::high%]" "03": "High"
} }
}, },
"detergent_water_hardness": { "detergent_water_hardness": {
"name": "Detergent water hardness", "name": "Detergent water hardness",
"state": { "state": {
"01": "Soft", "01": "Soft",
"02": "[%key:common::state::medium%]", "02": "Medium",
"03": "Hard" "03": "Hard"
} }
}, },
@@ -220,8 +220,8 @@
"finish_sound": { "finish_sound": {
"name": "Finish sound", "name": "Finish sound",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "Off",
"on": "[%key:common::state::on%]" "on": "On"
} }
}, },
"flex_zone_mode": { "flex_zone_mode": {
@@ -242,16 +242,16 @@
"heated_dry": { "heated_dry": {
"name": "Smart Dry", "name": "Smart Dry",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "Off",
"low": "[%key:common::state::low%]", "low": "Low",
"high": "[%key:common::state::high%]", "high": "High",
"extra_high": "Extra high" "extra_high": "Extra high"
} }
}, },
"ice_type": { "ice_type": {
"name": "{instance_name} type", "name": "{instance_name} type",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "Off",
"whiskey_iceball_3": "3 balls/day", "whiskey_iceball_3": "3 balls/day",
"whiskey_iceball_6": "6 balls/day", "whiskey_iceball_6": "6 balls/day",
"whiskey_iceball_9": "9 balls/day" "whiskey_iceball_9": "9 balls/day"
@@ -260,15 +260,15 @@
"led_brightness": { "led_brightness": {
"name": "Door LED brightness", "name": "Door LED brightness",
"state": { "state": {
"low": "[%key:common::state::low%]", "low": "Low",
"high": "[%key:common::state::high%]" "high": "High"
} }
}, },
"led_night_brightness": { "led_night_brightness": {
"name": "Door LED night brightness", "name": "Door LED night brightness",
"state": { "state": {
"low": "[%key:common::state::low%]", "low": "Low",
"high": "[%key:common::state::high%]" "high": "High"
} }
}, },
"oven_mode": { "oven_mode": {
@@ -297,7 +297,7 @@
"range_burner_power_level": { "range_burner_power_level": {
"name": "Burner {number} power level", "name": "Burner {number} power level",
"state": { "state": {
"0": "[%key:common::state::off%]", "0": "Off",
"boost": "Boost", "boost": "Boost",
"simmer": "Simmer" "simmer": "Simmer"
} }
@@ -324,9 +324,9 @@
"name": "Softener quantity", "name": "Softener quantity",
"state": { "state": {
"00": "None", "00": "None",
"01": "[%key:common::state::low%]", "01": "Low",
"02": "[%key:common::state::medium%]", "02": "Medium",
"03": "[%key:common::state::high%]" "03": "High"
} }
}, },
"sound_mode": { "sound_mode": {
@@ -342,9 +342,9 @@
"state": { "state": {
"rinse_hold": "Rinse hold", "rinse_hold": "Rinse hold",
"no_spin": "No spin", "no_spin": "No spin",
"low": "[%key:common::state::low%]", "low": "Low",
"medium": "[%key:common::state::medium%]", "medium": "Medium",
"high": "[%key:common::state::high%]" "high": "High"
} }
}, },
"wash_temperature": { "wash_temperature": {
@@ -400,7 +400,7 @@
"120": "2 hr", "120": "2 hr",
"180": "3 hr", "180": "3 hr",
"240": "4 hr", "240": "4 hr",
"none": "[%key:common::state::off%]", "none": "Off",
"cupboard": "Cupboard" "cupboard": "Cupboard"
} }
} }
@@ -441,7 +441,7 @@
"name": "Current limit level" "name": "Current limit level"
}, },
"current_temp_c": { "current_temp_c": {
"name": "[%key:component::sensor::entity_component::temperature::name%]" "name": "Temperature"
}, },
"diagnosis": { "diagnosis": {
"name": "Diagnosis" "name": "Diagnosis"
@@ -468,7 +468,7 @@
"name": "Dust" "name": "Dust"
}, },
"energy_kwh": { "energy_kwh": {
"name": "[%key:component::sensor::entity_component::energy::name%]" "name": "Energy"
}, },
"energy_last_month_kwh": { "energy_last_month_kwh": {
"name": "Energy (last month)" "name": "Energy (last month)"
@@ -555,7 +555,7 @@
"name": "Power energy" "name": "Power energy"
}, },
"power_watts": { "power_watts": {
"name": "[%key:component::sensor::entity_component::power::name%]" "name": "Power"
}, },
"progress": { "progress": {
"name": "Progress" "name": "Progress"
@@ -581,15 +581,15 @@
"machine_state": { "machine_state": {
"name": "Machine state", "name": "Machine state",
"state": { "state": {
"idle": "[%key:common::state::idle%]", "idle": "Idle",
"active": "[%key:common::state::active%]", "active": "Active",
"pause": "Paused" "pause": "Paused"
} }
}, },
"filter_status": { "filter_status": {
"name": "Filter status", "name": "Filter status",
"state": { "state": {
"normal": "[%key:common::state::normal%]", "normal": "Normal",
"wash": "Wash", "wash": "Wash",
"replace": "Replace" "replace": "Replace"
} }
@@ -597,7 +597,7 @@
"ice_making_status": { "ice_making_status": {
"name": "{instance_name} making status", "name": "{instance_name} making status",
"state": { "state": {
"icestatus_stop": "[%key:common::state::idle%]", "icestatus_stop": "Idle",
"icestatus_run": "Making ice" "icestatus_run": "Making ice"
} }
} }
@@ -756,7 +756,7 @@
"unknown": "Unexpected error. Check the Home Assistant logs for details." "unknown": "Unexpected error. Check the Home Assistant logs for details."
}, },
"abort": { "abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]" "already_configured": "Device is already configured"
} }
}, },
"options": { "options": {
@@ -20,7 +20,7 @@
"name": "Stroombegrenzing ingeschakeld" "name": "Stroombegrenzing ingeschakeld"
}, },
"cycle_active": { "cycle_active": {
"name": "[%key:component::binary_sensor::entity_component::running::name%]" "name": "Actief"
}, },
"defrost_active": { "defrost_active": {
"name": "Ontdooien actief" "name": "Ontdooien actief"
@@ -32,7 +32,7 @@
"name": "Apparaat actief" "name": "Apparaat actief"
}, },
"door_open": { "door_open": {
"name": "[%key:component::binary_sensor::entity_component::door::name%]" "name": "Deur"
}, },
"firmware_update": { "firmware_update": {
"name": "Firmware-update beschikbaar" "name": "Firmware-update beschikbaar"
@@ -73,16 +73,16 @@
"name": "Diagnose starten" "name": "Diagnose starten"
}, },
"pause": { "pause": {
"name": "[%key:common::action::pause%]" "name": "Pauzeren"
}, },
"selfcheck_start": { "selfcheck_start": {
"name": "Zelfcontrole starten" "name": "Zelfcontrole starten"
}, },
"start": { "start": {
"name": "[%key:common::action::start%]" "name": "Starten"
}, },
"stop": { "stop": {
"name": "[%key:common::action::stop%]" "name": "Stoppen"
} }
}, },
"climate": { "climate": {
@@ -134,24 +134,24 @@
"brightness_level": { "brightness_level": {
"name": "Nachthelderheid", "name": "Nachthelderheid",
"state": { "state": {
"33": "[%key:common::state::low%]", "33": "Laag",
"66": "[%key:common::state::medium%]", "66": "Gemiddeld",
"100": "[%key:common::state::high%]" "100": "Hoog"
} }
}, },
"day_brightness": { "day_brightness": {
"name": "Helderheid kast", "name": "Helderheid kast",
"state": { "state": {
"33": "[%key:common::state::low%]", "33": "Laag",
"66": "[%key:common::state::medium%]", "66": "Gemiddeld",
"100": "[%key:common::state::high%]" "100": "Hoog"
} }
}, },
"buzzer_sound": { "buzzer_sound": {
"name": "Zoemergeluid", "name": "Zoemergeluid",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "Uit",
"on": "[%key:common::state::on%]" "on": "Aan"
} }
}, },
"cycle": { "cycle": {
@@ -161,16 +161,16 @@
"name": "Hoeveelheid wasmiddel", "name": "Hoeveelheid wasmiddel",
"state": { "state": {
"00": "Geen", "00": "Geen",
"01": "[%key:common::state::low%]", "01": "Laag",
"02": "[%key:common::state::medium%]", "02": "Gemiddeld",
"03": "[%key:common::state::high%]" "03": "Hoog"
} }
}, },
"detergent_water_hardness": { "detergent_water_hardness": {
"name": "Waterhardheid voor wasmiddel", "name": "Waterhardheid voor wasmiddel",
"state": { "state": {
"01": "Zacht", "01": "Zacht",
"02": "[%key:common::state::medium%]", "02": "Gemiddeld",
"03": "Hard" "03": "Hard"
} }
}, },
@@ -220,8 +220,8 @@
"finish_sound": { "finish_sound": {
"name": "Eindgeluid", "name": "Eindgeluid",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "Uit",
"on": "[%key:common::state::on%]" "on": "Aan"
} }
}, },
"flex_zone_mode": { "flex_zone_mode": {
@@ -242,16 +242,16 @@
"heated_dry": { "heated_dry": {
"name": "Smart Dry", "name": "Smart Dry",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "Uit",
"low": "[%key:common::state::low%]", "low": "Laag",
"high": "[%key:common::state::high%]", "high": "Hoog",
"extra_high": "Extra hoog" "extra_high": "Extra hoog"
} }
}, },
"ice_type": { "ice_type": {
"name": "Type {instance_name}", "name": "Type {instance_name}",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "Uit",
"whiskey_iceball_3": "3 ijsballen per dag", "whiskey_iceball_3": "3 ijsballen per dag",
"whiskey_iceball_6": "6 ijsballen per dag", "whiskey_iceball_6": "6 ijsballen per dag",
"whiskey_iceball_9": "9 ijsballen per dag" "whiskey_iceball_9": "9 ijsballen per dag"
@@ -260,15 +260,15 @@
"led_brightness": { "led_brightness": {
"name": "Helderheid deur-LED", "name": "Helderheid deur-LED",
"state": { "state": {
"low": "[%key:common::state::low%]", "low": "Laag",
"high": "[%key:common::state::high%]" "high": "Hoog"
} }
}, },
"led_night_brightness": { "led_night_brightness": {
"name": "Nachtelijke helderheid deur-LED", "name": "Nachtelijke helderheid deur-LED",
"state": { "state": {
"low": "[%key:common::state::low%]", "low": "Laag",
"high": "[%key:common::state::high%]" "high": "Hoog"
} }
}, },
"oven_mode": { "oven_mode": {
@@ -297,7 +297,7 @@
"range_burner_power_level": { "range_burner_power_level": {
"name": "Vermogensniveau brander {number}", "name": "Vermogensniveau brander {number}",
"state": { "state": {
"0": "[%key:common::state::off%]", "0": "Uit",
"boost": "Boost", "boost": "Boost",
"simmer": "Sudderen" "simmer": "Sudderen"
} }
@@ -324,9 +324,9 @@
"name": "Hoeveelheid wasverzachter", "name": "Hoeveelheid wasverzachter",
"state": { "state": {
"00": "Geen", "00": "Geen",
"01": "[%key:common::state::low%]", "01": "Laag",
"02": "[%key:common::state::medium%]", "02": "Gemiddeld",
"03": "[%key:common::state::high%]" "03": "Hoog"
} }
}, },
"sound_mode": { "sound_mode": {
@@ -342,9 +342,9 @@
"state": { "state": {
"rinse_hold": "Spoelstop", "rinse_hold": "Spoelstop",
"no_spin": "Niet centrifugeren", "no_spin": "Niet centrifugeren",
"low": "[%key:common::state::low%]", "low": "Laag",
"medium": "[%key:common::state::medium%]", "medium": "Gemiddeld",
"high": "[%key:common::state::high%]" "high": "Hoog"
} }
}, },
"wash_temperature": { "wash_temperature": {
@@ -400,7 +400,7 @@
"120": "2 uur", "120": "2 uur",
"180": "3 uur", "180": "3 uur",
"240": "4 uur", "240": "4 uur",
"none": "[%key:common::state::off%]", "none": "Uit",
"cupboard": "Kastdroog" "cupboard": "Kastdroog"
} }
} }
@@ -441,7 +441,7 @@
"name": "Niveau stroombegrenzing" "name": "Niveau stroombegrenzing"
}, },
"current_temp_c": { "current_temp_c": {
"name": "[%key:component::sensor::entity_component::temperature::name%]" "name": "Temperatuur"
}, },
"diagnosis": { "diagnosis": {
"name": "Diagnose" "name": "Diagnose"
@@ -468,7 +468,7 @@
"name": "Stof" "name": "Stof"
}, },
"energy_kwh": { "energy_kwh": {
"name": "[%key:component::sensor::entity_component::energy::name%]" "name": "Energie"
}, },
"energy_last_month_kwh": { "energy_last_month_kwh": {
"name": "Energie (vorige maand)" "name": "Energie (vorige maand)"
@@ -555,7 +555,7 @@
"name": "Energieverbruik" "name": "Energieverbruik"
}, },
"power_watts": { "power_watts": {
"name": "[%key:component::sensor::entity_component::power::name%]" "name": "Vermogen"
}, },
"progress": { "progress": {
"name": "Voortgang" "name": "Voortgang"
@@ -581,15 +581,15 @@
"machine_state": { "machine_state": {
"name": "Machinestatus", "name": "Machinestatus",
"state": { "state": {
"idle": "[%key:common::state::idle%]", "idle": "Inactief",
"active": "[%key:common::state::active%]", "active": "Actief",
"pause": "Gepauzeerd" "pause": "Gepauzeerd"
} }
}, },
"filter_status": { "filter_status": {
"name": "Filterstatus", "name": "Filterstatus",
"state": { "state": {
"normal": "[%key:common::state::normal%]", "normal": "Normaal",
"wash": "Reinigen", "wash": "Reinigen",
"replace": "Vervangen" "replace": "Vervangen"
} }
@@ -597,7 +597,7 @@
"ice_making_status": { "ice_making_status": {
"name": "{instance_name} ijsmaakstatus", "name": "{instance_name} ijsmaakstatus",
"state": { "state": {
"icestatus_stop": "[%key:common::state::idle%]", "icestatus_stop": "Inactief",
"icestatus_run": "IJs maken" "icestatus_run": "IJs maken"
} }
} }
@@ -756,7 +756,7 @@
"unknown": "Onverwachte fout. Raadpleeg de Home Assistant-logboeken voor meer informatie." "unknown": "Onverwachte fout. Raadpleeg de Home Assistant-logboeken voor meer informatie."
}, },
"abort": { "abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]" "already_configured": "Apparaat is al geconfigureerd"
} }
}, },
"options": { "options": {
+20 -2
View File
@@ -72,8 +72,26 @@ def _all_descriptions():
yield from visit(value) yield from visit(value)
def test_source_and_english_translation_are_identical(): def test_source_and_english_translation_topology_and_placeholders_match():
assert _load("strings.json") == _load("translations/en.json") source = _load("strings.json")
english = _load("translations/en.json")
assert _topology(source) == _topology(english)
english_strings = dict(_walk_strings(english))
for path, value in _walk_strings(source):
assert _placeholders(value) == _placeholders(english_strings[path]), path
def test_runtime_translation_catalogs_have_no_unresolved_references():
for language in ("en", "nl"):
unresolved = [
(path, value)
for path, value in _walk_strings(
_load(f"translations/{language}.json")
)
if "[%key:" in value
]
assert unresolved == []
def test_english_and_dutch_catalog_topology_and_placeholders_match(): def test_english_and_dutch_catalog_topology_and_placeholders_match():