X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fcore%2Frouting%2Fcan-deactivate-guard.service.ts;h=8fce495e984f98bd3ffe5cb6f56c828ea736011a;hb=10ef089102f2225c5ec3ed426bc612e4f2bc8655;hp=e0405293ae95884cf0d08fc153922bda42f0b2a7;hpb=67ed6552b831df66713bac9e672738796128d33f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/core/routing/can-deactivate-guard.service.ts b/client/src/app/core/routing/can-deactivate-guard.service.ts index e0405293a..8fce495e9 100644 --- a/client/src/app/core/routing/can-deactivate-guard.service.ts +++ b/client/src/app/core/routing/can-deactivate-guard.service.ts @@ -2,7 +2,6 @@ import { Observable } from 'rxjs' import { Injectable } from '@angular/core' import { CanDeactivate } from '@angular/router' import { ConfirmService } from '@app/core/confirm' -import { I18n } from '@ngx-translate/i18n-polyfill' export type CanComponentDeactivateResult = { text?: string, canDeactivate: Observable | boolean } @@ -12,18 +11,16 @@ export interface CanComponentDeactivate { @Injectable() export class CanDeactivateGuard implements CanDeactivate { - constructor ( - private confirmService: ConfirmService, - private i18n: I18n - ) { } + + constructor (private confirmService: ConfirmService) { } canDeactivate (component: CanComponentDeactivate) { const result = component.canDeactivate() - const text = result.text || this.i18n('All unsaved data will be lost, are you sure you want to leave this page?') + const text = result.text || $localize`All unsaved data will be lost, are you sure you want to leave this page?` return result.canDeactivate || this.confirmService.confirm( text, - this.i18n('Warning') + $localize`Warning` ) }