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 --- .../app/+admin/follows/shared/redundancy-checkbox.component.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'client/src/app/+admin/follows/shared') diff --git a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts index 662143abc..729b7f599 100644 --- a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts +++ b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts @@ -1,7 +1,6 @@ import { Component, Input } from '@angular/core' import { Notifier } from '@app/core' import { RedundancyService } from '@app/shared/shared-main' -import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ selector: 'my-redundancy-checkbox', @@ -14,17 +13,16 @@ export class RedundancyCheckboxComponent { constructor ( private notifier: Notifier, - private redundancyService: RedundancyService, - private i18n: I18n - ) { } + private redundancyService: RedundancyService + ) { } updateRedundancyState () { this.redundancyService.updateRedundancy(this.host, this.redundancyAllowed) .subscribe( () => { - const stateLabel = this.redundancyAllowed ? this.i18n('enabled') : this.i18n('disabled') + const stateLabel = this.redundancyAllowed ? $localize`enabled` : $localize`disabled` - this.notifier.success(this.i18n('Redundancy for {{host}} is {{stateLabel}}', { host: this.host, stateLabel })) + this.notifier.success($localize`Redundancy for ${this.host} is ${stateLabel}`) }, err => this.notifier.error(err.message) -- cgit v1.2.3