From cb54210c192bdbedab5d3333cc2602df8e23a38a Mon Sep 17 00:00:00 2001 From: kimsible Date: Fri, 7 Aug 2020 18:41:05 +0200 Subject: Use comment as label for comments-thread add button --- .../+video-watch/comment/video-comment-add.component.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts') diff --git a/client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts b/client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts index c1ddc0695..c6e9c73b8 100644 --- a/client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts +++ b/client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts @@ -7,6 +7,7 @@ import { Video } from '@app/shared/shared-main' import { VideoComment, VideoCommentService } from '@app/shared/shared-video-comment' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { VideoCommentCreate } from '@shared/models' +import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ selector: 'my-video-comment-add', @@ -20,6 +21,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges, @Input() parentComments: VideoComment[] @Input() focusOnInit = false @Input() textValue?: string + @Input() commentThread?: boolean @Output() commentCreated = new EventEmitter() @Output() cancel = new EventEmitter() @@ -28,6 +30,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges, @ViewChild('textarea', { static: true }) textareaElement: ElementRef addingComment = false + addingCommentButtonValue: string constructor ( protected formValidatorService: FormValidatorService, @@ -35,7 +38,8 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges, private notifier: Notifier, private videoCommentService: VideoCommentService, private modalService: NgbModal, - private router: Router + private router: Router, + private i18n: I18n ) { super() } @@ -46,6 +50,12 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges, }) if (this.user) { + if (this.commentThread) { + this.addingCommentButtonValue = this.i18n('Comment') + } else { + this.addingCommentButtonValue = this.i18n('Reply') + } + if (this.textValue) { this.patchTextValue(this.textValue, this.focusOnInit) return -- cgit v1.2.3