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 --- .../shared-moderation/report-modals/account-report.component.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'client/src/app/shared/shared-moderation/report-modals/account-report.component.ts') diff --git a/client/src/app/shared/shared-moderation/report-modals/account-report.component.ts b/client/src/app/shared/shared-moderation/report-modals/account-report.component.ts index 08dbe9538..8ab2fe940 100644 --- a/client/src/app/shared/shared-moderation/report-modals/account-report.component.ts +++ b/client/src/app/shared/shared-moderation/report-modals/account-report.component.ts @@ -5,7 +5,6 @@ import { AbuseValidatorsService, FormReactive, FormValidatorService } from '@app import { Account } from '@app/shared/shared-main' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' -import { I18n } from '@ngx-translate/i18n-polyfill' import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse' import { AbusePredefinedReasonsString } from '@shared/models' import { AbuseService } from '../abuse.service' @@ -31,8 +30,7 @@ export class AccountReportComponent extends FormReactive implements OnInit { private modalService: NgbModal, private abuseValidatorsService: AbuseValidatorsService, private abuseService: AbuseService, - private notifier: Notifier, - private i18n: I18n + private notifier: Notifier ) { super() } @@ -50,7 +48,7 @@ export class AccountReportComponent extends FormReactive implements OnInit { } ngOnInit () { - this.modalTitle = this.i18n('Report {{displayName}}', { displayName: this.account.displayName }) + this.modalTitle = $localize`Report ${this.account.displayName}` this.buildForm({ reason: this.abuseValidatorsService.ABUSE_REASON, @@ -81,7 +79,7 @@ export class AccountReportComponent extends FormReactive implements OnInit { } }).subscribe( () => { - this.notifier.success(this.i18n('Account reported.')) + this.notifier.success($localize`Account reported.`) this.hide() }, -- cgit v1.2.3