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/shared/shared-moderation/user-ban-modal.component.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'client/src/app/shared/shared-moderation/user-ban-modal.component.ts') diff --git a/client/src/app/shared/shared-moderation/user-ban-modal.component.ts b/client/src/app/shared/shared-moderation/user-ban-modal.component.ts index 124e58669..f9a0381c5 100644 --- a/client/src/app/shared/shared-moderation/user-ban-modal.component.ts +++ b/client/src/app/shared/shared-moderation/user-ban-modal.component.ts @@ -3,7 +3,6 @@ import { Notifier, UserService } from '@app/core' import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' 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 { User } from '@shared/models' @Component({ @@ -23,8 +22,7 @@ export class UserBanModalComponent extends FormReactive implements OnInit { private modalService: NgbModal, private notifier: Notifier, private userService: UserService, - private userValidatorsService: UserValidatorsService, - private i18n: I18n + private userValidatorsService: UserValidatorsService ) { super() } @@ -52,8 +50,8 @@ export class UserBanModalComponent extends FormReactive implements OnInit { .subscribe( () => { const message = Array.isArray(this.usersToBan) - ? this.i18n('{{num}} users banned.', { num: this.usersToBan.length }) - : this.i18n('User {{username}} banned.', { username: this.usersToBan.username }) + ? $localize`${this.usersToBan.length} users banned.` + : $localize`User ${this.usersToBan.username} banned.` this.notifier.success(message) -- cgit v1.2.3