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 --- .../src/app/+admin/system/logs/logs.component.ts | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'client/src/app/+admin/system/logs/logs.component.ts') diff --git a/client/src/app/+admin/system/logs/logs.component.ts b/client/src/app/+admin/system/logs/logs.component.ts index 51f047188..c9c9dc3d1 100644 --- a/client/src/app/+admin/system/logs/logs.component.ts +++ b/client/src/app/+admin/system/logs/logs.component.ts @@ -1,6 +1,5 @@ import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' import { Notifier } from '@app/core' -import { I18n } from '@ngx-translate/i18n-polyfill' import { LogLevel } from '@shared/models' import { LogRow } from './log-row.model' import { LogsService } from './logs.service' @@ -25,9 +24,8 @@ export class LogsComponent implements OnInit { constructor ( private logsService: LogsService, - private notifier: Notifier, - private i18n: I18n - ) { } + private notifier: Notifier + ) { } ngOnInit (): void { this.buildTimeChoices() @@ -78,15 +76,15 @@ export class LogsComponent implements OnInit { this.timeChoices = [ { id: lastWeek.toISOString(), - label: this.i18n('Last week') + label: $localize`Last week` }, { id: lastDay.toISOString(), - label: this.i18n('Last day') + label: $localize`Last day` }, { id: lastHour.toISOString(), - label: this.i18n('Last hour') + label: $localize`Last hour` } ] @@ -97,19 +95,19 @@ export class LogsComponent implements OnInit { this.levelChoices = [ { id: 'debug', - label: this.i18n('Debug') + label: $localize`Debug` }, { id: 'info', - label: this.i18n('Info') + label: $localize`Info` }, { id: 'warn', - label: this.i18n('Warning') + label: $localize`Warning` }, { id: 'error', - label: this.i18n('Error') + label: $localize`Error` } ] @@ -120,11 +118,11 @@ export class LogsComponent implements OnInit { this.logTypeChoices = [ { id: 'standard', - label: this.i18n('Standard logs') + label: $localize`Standard logs` }, { id: 'audit', - label: this.i18n('Audit logs') + label: $localize`Audit logs` } ] -- cgit v1.2.3