From 66357162f8e1227495f09bd4f68446aad7071c6d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 12 Aug 2020 10:40:04 +0200 Subject: Migrate to $localize * Remove i18n polyfill to translate things in components * Reduce bundle sizes * Improve runtime perf * Reduce a lot the time to make a full client build * Reduce client build complexity * We don't need a service to translate things anymore (so we will be able to translate title pages etc) Unfortunately we may loose some translations in the migration process. I'll put a message on weblate to notify translators --- client/src/app/core/routing/can-deactivate-guard.service.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'client/src/app/core/routing/can-deactivate-guard.service.ts') 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` ) } -- cgit v1.2.3