diff --git a/homeassistant/components/fronius/strings.json b/homeassistant/components/fronius/strings.json index ccfb88852a8..1eaa612a6e7 100644 --- a/homeassistant/components/fronius/strings.json +++ b/homeassistant/components/fronius/strings.json @@ -275,7 +275,7 @@ "name": "Relative self consumption" }, "capacity_maximum": { - "name": "Maximum capacity " + "name": "Maximum capacity" }, "capacity_designed": { "name": "Designed capacity" diff --git a/homeassistant/components/hive/strings.json b/homeassistant/components/hive/strings.json index bd4e95618e4..c8062a64ade 100644 --- a/homeassistant/components/hive/strings.json +++ b/homeassistant/components/hive/strings.json @@ -21,7 +21,7 @@ "data": { "device_name": "Device Name" }, - "description": "Enter your Hive configuration ", + "description": "Enter your Hive configuration", "title": "Hive Configuration." }, "reauth": { diff --git a/homeassistant/components/husqvarna_automower/strings.json b/homeassistant/components/husqvarna_automower/strings.json index 2c93c7492cf..f251a8bf5e0 100644 --- a/homeassistant/components/husqvarna_automower/strings.json +++ b/homeassistant/components/husqvarna_automower/strings.json @@ -55,7 +55,7 @@ "name": "Cutting height" }, "my_lawn_cutting_height": { - "name": "My lawn cutting height " + "name": "My lawn cutting height" }, "work_area_cutting_height": { "name": "{work_area} cutting height" diff --git a/homeassistant/components/madvr/strings.json b/homeassistant/components/madvr/strings.json index b8d30be23aa..06851efa2c8 100644 --- a/homeassistant/components/madvr/strings.json +++ b/homeassistant/components/madvr/strings.json @@ -3,7 +3,7 @@ "step": { "user": { "title": "Setup madVR Envy", - "description": "Your device needs to be on in order to add the integation. ", + "description": "Your device needs to be on in order to add the integation.", "data": { "host": "[%key:common::config_flow::data::host%]", "port": "[%key:common::config_flow::data::port%]" @@ -15,7 +15,7 @@ }, "reconfigure": { "title": "Reconfigure madVR Envy", - "description": "Your device needs to be on in order to reconfigure the integation. ", + "description": "Your device needs to be on in order to reconfigure the integation.", "data": { "host": "[%key:common::config_flow::data::host%]", "port": "[%key:common::config_flow::data::port%]" diff --git a/homeassistant/components/waze_travel_time/strings.json b/homeassistant/components/waze_travel_time/strings.json index 6b0b4184af7..507731fc973 100644 --- a/homeassistant/components/waze_travel_time/strings.json +++ b/homeassistant/components/waze_travel_time/strings.json @@ -100,7 +100,7 @@ }, "avoid_subscription_roads": { "name": "[%key:component::waze_travel_time::options::step::init::data::avoid_subscription_roads%]", - "description": "Whether to avoid subscription roads. " + "description": "Whether to avoid subscription roads." } } } diff --git a/script/hassfest/translations.py b/script/hassfest/translations.py index fa12ce626ad..50cfc62b5cf 100644 --- a/script/hassfest/translations.py +++ b/script/hassfest/translations.py @@ -131,11 +131,13 @@ def translation_value_validator(value: Any) -> str: - prevents strings with single quoted placeholders - prevents combined translations """ - value = cv.string_with_no_html(value) - value = string_no_single_quoted_placeholders(value) - if RE_COMBINED_REFERENCE.search(value): + string_value = cv.string_with_no_html(value) + string_value = string_no_single_quoted_placeholders(string_value) + if RE_COMBINED_REFERENCE.search(string_value): raise vol.Invalid("the string should not contain combined translations") - return str(value) + if string_value != string_value.strip(" "): + raise vol.Invalid("the string should not contain leading or trailing spaces") + return string_value def string_no_single_quoted_placeholders(value: str) -> str: diff --git a/tests/components/husqvarna_automower/snapshots/test_number.ambr b/tests/components/husqvarna_automower/snapshots/test_number.ambr index de8b397f01c..63e42ee5d5c 100644 --- a/tests/components/husqvarna_automower/snapshots/test_number.ambr +++ b/tests/components/husqvarna_automower/snapshots/test_number.ambr @@ -195,7 +195,7 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'My lawn cutting height ', + 'original_name': 'My lawn cutting height', 'platform': 'husqvarna_automower', 'previous_unique_id': None, 'supported_features': 0, @@ -207,7 +207,7 @@ # name: test_number_snapshot[number.test_mower_1_my_lawn_cutting_height-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Test Mower 1 My lawn cutting height ', + 'friendly_name': 'Test Mower 1 My lawn cutting height', 'max': 100.0, 'min': 0.0, 'mode': ,