diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/delete/delete.action.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/delete/delete.action.ts index a06468f874..4344e940c8 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/delete/delete.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/delete/delete.action.ts @@ -26,9 +26,16 @@ export class UmbDeleteEntityAction extends UmbEntityActionBase { + const message = this.args.meta.confirm?.message ?? '#defaultdialogs_confirmdelete'; + + /* We need to replace the token in a translation with the item name. + A string can potentially consist of multiple translation keys. + First we find all the translation keys in message. */ + const keysFromMessageString = this.#localize.getKeysFromString(message); + + // Second we create a map of the translation keys found in the message and the arguments that should replace the tokens. + // This will enable the localize service to pass and replace the tokens in the all the translations with the item name. + const argsMap: UmbLocalizeStringArgsMap = keysFromMessageString.reduce((acc: UmbLocalizeStringArgsMap, key) => { acc[key] = [item.name]; return acc; }, {}); @@ -36,7 +43,7 @@ export class UmbDeleteEntityAction extends UmbEntityActionBase