mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Update translations and error messages in Bring! integration (#135455)
* Update translations and error messages * use placeholder for field name * change key for translation string
This commit is contained in:
parent
ab0dfe304c
commit
ccb94ac6a6
@ -101,11 +101,11 @@
|
|||||||
"setup_authentication_exception": {
|
"setup_authentication_exception": {
|
||||||
"message": "Authentication failed for {email}, check your email and password"
|
"message": "Authentication failed for {email}, check your email and password"
|
||||||
},
|
},
|
||||||
"notify_missing_argument_item": {
|
"notify_missing_argument": {
|
||||||
"message": "Failed to perform action {service}. 'URGENT_MESSAGE' requires a value @ data['item']. Got None"
|
"message": "This action requires field {field}, please enter a valid value for {field}"
|
||||||
},
|
},
|
||||||
"notify_request_failed": {
|
"notify_request_failed": {
|
||||||
"message": "Failed to send push notification for bring due to a connection error, try again later"
|
"message": "Failed to send push notification for Bring! due to a connection error, try again later"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"services": {
|
"services": {
|
||||||
@ -122,8 +122,8 @@
|
|||||||
"description": "Type of push notification to send to list members."
|
"description": "Type of push notification to send to list members."
|
||||||
},
|
},
|
||||||
"item": {
|
"item": {
|
||||||
"name": "Article (Required if notification type `Urgent message` is selected)",
|
"name": "Item (Required if notification type 'Urgent message' is selected)",
|
||||||
"description": "Article name to include in an urgent message e.g. `Urgent message - Please buy Cilantro urgently`"
|
"description": "Item name(s) to include in an urgent message e.g. 'Attention! Attention! - We still urgently need: [Items]'"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -131,10 +131,10 @@
|
|||||||
"selector": {
|
"selector": {
|
||||||
"notification_type_selector": {
|
"notification_type_selector": {
|
||||||
"options": {
|
"options": {
|
||||||
"going_shopping": "I'm going shopping! - Last chance to make changes",
|
"going_shopping": "I'm going shopping! - Last chance for adjustments",
|
||||||
"changed_list": "List updated - Take a look at the articles",
|
"changed_list": "I changed the list! - Take a look at the items",
|
||||||
"shopping_done": "Shopping done - The fridge is well stocked",
|
"shopping_done": "The shopping is done - Our fridge is well stocked",
|
||||||
"urgent_message": "Urgent message - Please buy `Article` urgently"
|
"urgent_message": "Attention! Attention! - We still urgently need: [Items]"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -262,8 +262,6 @@ class BringTodoListEntity(BringBaseEntity, TodoListEntity):
|
|||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
raise ServiceValidationError(
|
raise ServiceValidationError(
|
||||||
translation_domain=DOMAIN,
|
translation_domain=DOMAIN,
|
||||||
translation_key="notify_missing_argument_item",
|
translation_key="notify_missing_argument",
|
||||||
translation_placeholders={
|
translation_placeholders={"field": "item"},
|
||||||
"service": f"{DOMAIN}.{SERVICE_PUSH_NOTIFICATION}",
|
|
||||||
},
|
|
||||||
) from e
|
) from e
|
||||||
|
@ -65,7 +65,7 @@ async def test_send_notification_exception(
|
|||||||
mock_bring_client.notify.side_effect = BringRequestException
|
mock_bring_client.notify.side_effect = BringRequestException
|
||||||
with pytest.raises(
|
with pytest.raises(
|
||||||
HomeAssistantError,
|
HomeAssistantError,
|
||||||
match="Failed to send push notification for bring due to a connection error, try again later",
|
match="Failed to send push notification for Bring! due to a connection error, try again later",
|
||||||
):
|
):
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
@ -94,7 +94,7 @@ async def test_send_notification_service_validation_error(
|
|||||||
with pytest.raises(
|
with pytest.raises(
|
||||||
HomeAssistantError,
|
HomeAssistantError,
|
||||||
match=re.escape(
|
match=re.escape(
|
||||||
"Failed to perform action bring.send_message. 'URGENT_MESSAGE' requires a value @ data['item']. Got None"
|
"This action requires field item, please enter a valid value for item"
|
||||||
),
|
),
|
||||||
):
|
):
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user