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/notification/notifier.service.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'client/src/app/core/notification/notifier.service.ts') diff --git a/client/src/app/core/notification/notifier.service.ts b/client/src/app/core/notification/notifier.service.ts index 9833c65a0..f736672bb 100644 --- a/client/src/app/core/notification/notifier.service.ts +++ b/client/src/app/core/notification/notifier.service.ts @@ -1,30 +1,26 @@ -import { Injectable } from '@angular/core' import { MessageService } from 'primeng/api' -import { I18n } from '@ngx-translate/i18n-polyfill' +import { Injectable } from '@angular/core' @Injectable() export class Notifier { readonly TIMEOUT = 5000 - constructor ( - private i18n: I18n, - private messageService: MessageService) { - } + constructor (private messageService: MessageService) { } info (text: string, title?: string, timeout?: number) { - if (!title) title = this.i18n('Info') + if (!title) title = $localize`Info` return this.notify('info', text, title, timeout) } error (text: string, title?: string, timeout?: number) { - if (!title) title = this.i18n('Error') + if (!title) title = $localize`Error` return this.notify('error', text, title, timeout) } success (text: string, title?: string, timeout?: number) { - if (!title) title = this.i18n('Success') + if (!title) title = $localize`Success` return this.notify('success', text, title, timeout) } -- cgit v1.2.3