aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/comment
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-12 10:40:04 +0200
committerChocobozzz <me@florianbigard.com>2020-08-14 10:28:30 +0200
commit66357162f8e1227495f09bd4f68446aad7071c6d (patch)
tree7d4429506deb512b2fe1d0267f38a28cda20af55 /client/src/app/+videos/+video-watch/comment
parent8c360747995e17eb5520e22fc3d7bd4c3d26eeee (diff)
downloadPeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.tar.gz
PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.tar.zst
PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.zip
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
Diffstat (limited to 'client/src/app/+videos/+video-watch/comment')
-rw-r--r--client/src/app/+videos/+video-watch/comment/video-comment.component.ts4
-rw-r--r--client/src/app/+videos/+video-watch/comment/video-comments.component.ts8
2 files changed, 4 insertions, 8 deletions
diff --git a/client/src/app/+videos/+video-watch/comment/video-comment.component.ts b/client/src/app/+videos/+video-watch/comment/video-comment.component.ts
index 36ec6e9f9..a84e91fd3 100644
--- a/client/src/app/+videos/+video-watch/comment/video-comment.component.ts
+++ b/client/src/app/+videos/+video-watch/comment/video-comment.component.ts
@@ -5,7 +5,6 @@ import { AuthService } from '@app/core/auth'
5import { Account, Actor, DropdownAction, Video } from '@app/shared/shared-main' 5import { Account, Actor, DropdownAction, Video } from '@app/shared/shared-main'
6import { CommentReportComponent } from '@app/shared/shared-moderation/report-modals/comment-report.component' 6import { CommentReportComponent } from '@app/shared/shared-moderation/report-modals/comment-report.component'
7import { VideoComment, VideoCommentThreadTree } from '@app/shared/shared-video-comment' 7import { VideoComment, VideoCommentThreadTree } from '@app/shared/shared-video-comment'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { User, UserRight } from '@shared/models' 8import { User, UserRight } from '@shared/models'
10 9
11@Component({ 10@Component({
@@ -39,7 +38,6 @@ export class VideoCommentComponent implements OnInit, OnChanges {
39 commentUser: User 38 commentUser: User
40 39
41 constructor ( 40 constructor (
42 private i18n: I18n,
43 private markdownService: MarkdownService, 41 private markdownService: MarkdownService,
44 private authService: AuthService, 42 private authService: AuthService,
45 private userService: UserService, 43 private userService: UserService,
@@ -138,7 +136,7 @@ export class VideoCommentComponent implements OnInit, OnChanges {
138 if (this.isUserLoggedIn() && this.comment.isDeleted === false && this.authService.getUser().account.id !== this.comment.account.id) { 136 if (this.isUserLoggedIn() && this.comment.isDeleted === false && this.authService.getUser().account.id !== this.comment.account.id) {
139 this.prependModerationActions = [ 137 this.prependModerationActions = [
140 { 138 {
141 label: this.i18n('Report comment'), 139 label: $localize`Report comment`,
142 handler: () => this.showReportModal() 140 handler: () => this.showReportModal()
143 } 141 }
144 ] 142 ]
diff --git a/client/src/app/+videos/+video-watch/comment/video-comments.component.ts b/client/src/app/+videos/+video-watch/comment/video-comments.component.ts
index 66494a20a..517844ab2 100644
--- a/client/src/app/+videos/+video-watch/comment/video-comments.component.ts
+++ b/client/src/app/+videos/+video-watch/comment/video-comments.component.ts
@@ -5,7 +5,6 @@ import { AuthService, ComponentPagination, ConfirmService, hasMoreItems, Notifie
5import { HooksService } from '@app/core/plugins/hooks.service' 5import { HooksService } from '@app/core/plugins/hooks.service'
6import { Syndication, VideoDetails } from '@app/shared/shared-main' 6import { Syndication, VideoDetails } from '@app/shared/shared-main'
7import { VideoComment, VideoCommentService, VideoCommentThreadTree } from '@app/shared/shared-video-comment' 7import { VideoComment, VideoCommentService, VideoCommentThreadTree } from '@app/shared/shared-video-comment'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9 8
10@Component({ 9@Component({
11 selector: 'my-video-comments', 10 selector: 'my-video-comments',
@@ -43,7 +42,6 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
43 private confirmService: ConfirmService, 42 private confirmService: ConfirmService,
44 private videoCommentService: VideoCommentService, 43 private videoCommentService: VideoCommentService,
45 private activatedRoute: ActivatedRoute, 44 private activatedRoute: ActivatedRoute,
46 private i18n: I18n,
47 private hooks: HooksService 45 private hooks: HooksService
48 ) {} 46 ) {}
49 47
@@ -162,12 +160,12 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
162 let message = 'Do you really want to delete this comment?' 160 let message = 'Do you really want to delete this comment?'
163 161
164 if (commentToDelete.isLocal || this.video.isLocal) { 162 if (commentToDelete.isLocal || this.video.isLocal) {
165 message += this.i18n(' The deletion will be sent to remote instances so they can reflect the change.') 163 message += $localize` The deletion will be sent to remote instances so they can reflect the change.`
166 } else { 164 } else {
167 message += this.i18n(' It is a remote comment, so the deletion will only be effective on your instance.') 165 message += $localize` It is a remote comment, so the deletion will only be effective on your instance.`
168 } 166 }
169 167
170 const res = await this.confirmService.confirm(message, this.i18n('Delete')) 168 const res = await this.confirmService.confirm(message, $localize`Delete`)
171 if (res === false) return 169 if (res === false) return
172 170
173 this.videoCommentService.deleteVideoComment(commentToDelete.videoId, commentToDelete.id) 171 this.videoCommentService.deleteVideoComment(commentToDelete.videoId, commentToDelete.id)