aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-edit/video-update.component.ts
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-edit/video-update.component.ts
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-edit/video-update.component.ts')
-rw-r--r--client/src/app/+videos/+video-edit/video-update.component.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/client/src/app/+videos/+video-edit/video-update.component.ts b/client/src/app/+videos/+video-edit/video-update.component.ts
index abd08f05c..2e1d0f89d 100644
--- a/client/src/app/+videos/+video-edit/video-update.component.ts
+++ b/client/src/app/+videos/+video-edit/video-update.component.ts
@@ -5,7 +5,6 @@ import { Notifier } from '@app/core'
5import { FormReactive, FormValidatorService, SelectChannelItem } from '@app/shared/shared-forms' 5import { FormReactive, FormValidatorService, SelectChannelItem } from '@app/shared/shared-forms'
6import { VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit, VideoService } from '@app/shared/shared-main' 6import { VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit, VideoService } from '@app/shared/shared-main'
7import { LoadingBarService } from '@ngx-loading-bar/core' 7import { LoadingBarService } from '@ngx-loading-bar/core'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { VideoPrivacy } from '@shared/models' 8import { VideoPrivacy } from '@shared/models'
10 9
11@Component({ 10@Component({
@@ -31,9 +30,8 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
31 private notifier: Notifier, 30 private notifier: Notifier,
32 private videoService: VideoService, 31 private videoService: VideoService,
33 private loadingBar: LoadingBarService, 32 private loadingBar: LoadingBarService,
34 private videoCaptionService: VideoCaptionService, 33 private videoCaptionService: VideoCaptionService
35 private i18n: I18n 34 ) {
36 ) {
37 super() 35 super()
38 } 36 }
39 37
@@ -78,7 +76,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
78 canDeactivate (): { canDeactivate: boolean, text?: string } { 76 canDeactivate (): { canDeactivate: boolean, text?: string } {
79 if (this.updateDone === true) return { canDeactivate: true } 77 if (this.updateDone === true) return { canDeactivate: true }
80 78
81 const text = this.i18n('You have unsaved changes! If you leave, your changes will be lost.') 79 const text = $localize`You have unsaved changes! If you leave, your changes will be lost.`
82 80
83 for (const caption of this.videoCaptions) { 81 for (const caption of this.videoCaptions) {
84 if (caption.action) return { canDeactivate: false, text } 82 if (caption.action) return { canDeactivate: false, text }
@@ -115,7 +113,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
115 this.updateDone = true 113 this.updateDone = true
116 this.isUpdatingVideo = false 114 this.isUpdatingVideo = false
117 this.loadingBar.useRef().complete() 115 this.loadingBar.useRef().complete()
118 this.notifier.success(this.i18n('Video updated.')) 116 this.notifier.success($localize`Video updated.`)
119 this.router.navigate([ '/videos/watch', this.video.uuid ]) 117 this.router.navigate([ '/videos/watch', this.video.uuid ])
120 }, 118 },
121 119