From 41aec25b913d9904dba3cd6fe058c32f556eed92 Mon Sep 17 00:00:00 2001 From: Cilibiu Bogdan Date: Tue, 21 Nov 2017 18:29:01 +0200 Subject: [PATCH] [ACA-1016] translate Undo action text (#72) --- src/app/common/directives/node-delete.directive.spec.ts | 8 ++++---- src/app/common/directives/node-delete.directive.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/common/directives/node-delete.directive.spec.ts b/src/app/common/directives/node-delete.directive.spec.ts index 170a1a5c0..d53509d22 100644 --- a/src/app/common/directives/node-delete.directive.spec.ts +++ b/src/app/common/directives/node-delete.directive.spec.ts @@ -84,7 +84,7 @@ describe('NodeDeleteDirective', () => { element.triggerEventHandler('click', null); expect(notificationService.openSnackMessageAction).toHaveBeenCalledWith( - 'APP.MESSAGES.INFO.NODE_DELETION.SINGULAR', 'Undo', 10000 + 'APP.MESSAGES.INFO.NODE_DELETION.SINGULAR', 'APP.ACTIONS.UNDO', 10000 ); }); @@ -113,7 +113,7 @@ describe('NodeDeleteDirective', () => { element.triggerEventHandler('click', null); expect(notificationService.openSnackMessageAction).toHaveBeenCalledWith( - 'APP.MESSAGES.INFO.NODE_DELETION.PLURAL', 'Undo', 10000 + 'APP.MESSAGES.INFO.NODE_DELETION.PLURAL', 'APP.ACTIONS.UNDO', 10000 ); }); @@ -151,7 +151,7 @@ describe('NodeDeleteDirective', () => { element.triggerEventHandler('click', null); expect(notificationService.openSnackMessageAction).toHaveBeenCalledWith( - 'APP.MESSAGES.INFO.NODE_DELETION.PARTIAL_SINGULAR', 'Undo', 10000 + 'APP.MESSAGES.INFO.NODE_DELETION.PARTIAL_SINGULAR', 'APP.ACTIONS.UNDO', 10000 ); }); @@ -180,7 +180,7 @@ describe('NodeDeleteDirective', () => { element.triggerEventHandler('click', null); expect(notificationService.openSnackMessageAction).toHaveBeenCalledWith( - 'APP.MESSAGES.INFO.NODE_DELETION.PARTIAL_PLURAL', 'Undo', 10000 + 'APP.MESSAGES.INFO.NODE_DELETION.PARTIAL_PLURAL', 'APP.ACTIONS.UNDO', 10000 ); }); }); diff --git a/src/app/common/directives/node-delete.directive.ts b/src/app/common/directives/node-delete.directive.ts index 30d09e33e..266c9b814 100644 --- a/src/app/common/directives/node-delete.directive.ts +++ b/src/app/common/directives/node-delete.directive.ts @@ -59,7 +59,7 @@ export class NodeDeleteDirective { this.getDeleteMesssage(processedData) .subscribe((message) => { - const withUndo = processedData.someSucceeded ? 'Undo' : ''; + const withUndo = processedData.someSucceeded ? this.translation.translate.instant('APP.ACTIONS.UNDO') : ''; this.notification.openSnackMessageAction(message, withUndo, NodeDeleteDirective.DELETE_MESSAGE_DURATION) .onAction()