File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
src/panels/config/lovelace/dashboards Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -309,7 +309,20 @@ export class DialogLovelaceDashboardDetail extends LitElement {
309309 }
310310 this . closeDialog ( ) ;
311311 } catch ( err : any ) {
312- this . _error = { base : err ?. message || "Unknown error" } ;
312+ let localizedErrorMessage : string | undefined ;
313+ if ( err ?. translation_domain && err ?. translation_key ) {
314+ const localize = await this . hass . loadBackendTranslation (
315+ "exceptions" ,
316+ err . translation_domain
317+ ) ;
318+ localizedErrorMessage = localize (
319+ `component.${ err . translation_domain } .exceptions.${ err . translation_key } .message` ,
320+ err . translation_placeholders
321+ ) ;
322+ }
323+ this . _error = {
324+ base : localizedErrorMessage || err ?. message || "Unknown error" ,
325+ } ;
313326 } finally {
314327 this . _submitting = false ;
315328 }
You can’t perform that action at this time.
0 commit comments