Add translation for unknown entity (#21484)

* unknown entity

* prettier
This commit is contained in:
Simon Lamon 2024-07-31 11:05:14 +02:00 committed by GitHub
parent dbd84901f8
commit 1f90a0c2e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View File

@ -178,7 +178,11 @@ const getEntityName = (
entityId: string | undefined
): string => {
if (!entityId) {
return "<unknown entity>";
return (
"<" +
hass.localize("ui.panel.config.automation.editor.unknown_entity") +
">"
);
}
if (entityId.includes(".")) {
const state = hass.states[entityId];
@ -191,7 +195,11 @@ const getEntityName = (
if (entityReg) {
return computeEntityRegistryName(hass, entityReg) || entityId;
}
return "<unknown entity>";
return (
"<" +
hass.localize("ui.panel.config.automation.editor.unknown_entity") +
">"
);
};
export const localizeDeviceAutomationAction = (

View File

@ -2837,6 +2837,7 @@
"edit_ui": "Edit in visual editor",
"copy_to_clipboard": "Copy to clipboard",
"search_in": "Search · {group}",
"unknown_entity": "unknown entity",
"triggers": {
"name": "Triggers",
"header": "When",