X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-moderation%2Freport-modals%2Fcomment-report.component.ts;h=c7395c7b756ebde9674cea83971708b7c36e65ed;hb=9162fdd36300d2478f13d6ad346ec2c323f40faa;hp=2769874d9ad18345ad4a7e1f4fe641522ed24d7e;hpb=bd45d503e5d007e730f4e81dccd7e7864c9a85cc;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-moderation/report-modals/comment-report.component.ts b/client/src/app/shared/shared-moderation/report-modals/comment-report.component.ts index 2769874d9..c7395c7b7 100644 --- a/client/src/app/shared/shared-moderation/report-modals/comment-report.component.ts +++ b/client/src/app/shared/shared-moderation/report-modals/comment-report.component.ts @@ -1,11 +1,11 @@ import { mapValues, pickBy } from 'lodash-es' import { Component, Input, OnInit, ViewChild } from '@angular/core' import { Notifier } from '@app/core' -import { AbuseValidatorsService, FormReactive, FormValidatorService } from '@app/shared/shared-forms' +import { ABUSE_REASON_VALIDATOR } from '@app/shared/form-validators/abuse-validators' +import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' import { VideoComment } from '@app/shared/shared-video-comment' 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' @@ -29,10 +29,8 @@ export class CommentReportComponent extends FormReactive implements OnInit { constructor ( protected formValidatorService: FormValidatorService, private modalService: NgbModal, - private abuseValidatorsService: AbuseValidatorsService, private abuseService: AbuseService, - private notifier: Notifier, - private i18n: I18n + private notifier: Notifier ) { super() } @@ -50,10 +48,10 @@ export class CommentReportComponent extends FormReactive implements OnInit { } ngOnInit () { - this.modalTitle = this.i18n('Report comment') + this.modalTitle = $localize`Report comment` this.buildForm({ - reason: this.abuseValidatorsService.ABUSE_REASON, + reason: ABUSE_REASON_VALIDATOR, predefinedReasons: mapValues(abusePredefinedReasonsMap, r => null) }) @@ -81,7 +79,7 @@ export class CommentReportComponent extends FormReactive implements OnInit { } }).subscribe( () => { - this.notifier.success(this.i18n('Comment reported.')) + this.notifier.success($localize`Comment reported.`) this.hide() },