diff --git a/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts b/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts index f633253d009e..df3e7c17174a 100644 --- a/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts +++ b/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts @@ -283,6 +283,15 @@ export class DialogLovelaceDashboardDetail extends LitElement { } this.closeDialog(); } catch (err: any) { + if (err?.translation_key === "url_already_exists") { + this._error = { + url_path: this.hass!.localize( + "ui.panel.config.lovelace.dashboards.detail.url_already_exists", + err?.translation_placeholders + ), + }; + return; + } this._error = { base: err?.message || "Unknown error" }; } finally { this._submitting = false; diff --git a/src/translations/en.json b/src/translations/en.json index 90d994c9ba49..bc474baaf9b4 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -3433,6 +3433,7 @@ "title": "Title", "title_required": "Title is required.", "url": "URL", + "url_already_exists": "The {url} URL is already in use. Please choose a different one.", "url_error_msg": "The URL should contain a - and cannot contain spaces or special characters, except for _ and -", "require_admin": "Admin only", "delete": "Delete",