aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.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/+my-account/my-account-video-playlists/my-account-video-playlist-create.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/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts')
-rw-r--r--client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts14
1 files changed, 5 insertions, 9 deletions
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts
index e72ae2366..5427dc3a0 100644
--- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts
+++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts
@@ -1,13 +1,12 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { Router } from '@angular/router' 2import { Router } from '@angular/router'
3import { AuthService, Notifier, ServerService } from '@app/core' 3import { AuthService, Notifier, ServerService } from '@app/core'
4import { populateAsyncUserVideoChannels } from '@app/helpers'
4import { FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms' 5import { FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms'
5import { VideoPlaylistService } from '@app/shared/shared-video-playlist' 6import { VideoPlaylistService } from '@app/shared/shared-video-playlist'
6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { VideoPlaylistCreate } from '@shared/models/videos/playlist/video-playlist-create.model' 7import { VideoPlaylistCreate } from '@shared/models/videos/playlist/video-playlist-create.model'
8import { VideoPlaylistPrivacy } from '@shared/models/videos/playlist/video-playlist-privacy.model' 8import { VideoPlaylistPrivacy } from '@shared/models/videos/playlist/video-playlist-privacy.model'
9import { MyAccountVideoPlaylistEdit } from './my-account-video-playlist-edit' 9import { MyAccountVideoPlaylistEdit } from './my-account-video-playlist-edit'
10import { populateAsyncUserVideoChannels } from '@app/helpers'
11 10
12@Component({ 11@Component({
13 selector: 'my-account-video-playlist-create', 12 selector: 'my-account-video-playlist-create',
@@ -24,9 +23,8 @@ export class MyAccountVideoPlaylistCreateComponent extends MyAccountVideoPlaylis
24 private notifier: Notifier, 23 private notifier: Notifier,
25 private router: Router, 24 private router: Router,
26 private videoPlaylistService: VideoPlaylistService, 25 private videoPlaylistService: VideoPlaylistService,
27 private serverService: ServerService, 26 private serverService: ServerService
28 private i18n: I18n 27 ) {
29 ) {
30 super() 28 super()
31 } 29 }
32 30
@@ -70,9 +68,7 @@ export class MyAccountVideoPlaylistCreateComponent extends MyAccountVideoPlaylis
70 68
71 this.videoPlaylistService.createVideoPlaylist(videoPlaylistCreate).subscribe( 69 this.videoPlaylistService.createVideoPlaylist(videoPlaylistCreate).subscribe(
72 () => { 70 () => {
73 this.notifier.success( 71 this.notifier.success($localize`Playlist ${videoPlaylistCreate.displayName} created.`)
74 this.i18n('Playlist {{playlistName}} created.', { playlistName: videoPlaylistCreate.displayName })
75 )
76 this.router.navigate([ '/my-account', 'video-playlists' ]) 72 this.router.navigate([ '/my-account', 'video-playlists' ])
77 }, 73 },
78 74
@@ -85,6 +81,6 @@ export class MyAccountVideoPlaylistCreateComponent extends MyAccountVideoPlaylis
85 } 81 }
86 82
87 getFormButtonTitle () { 83 getFormButtonTitle () {
88 return this.i18n('Create') 84 return $localize`Create`
89 } 85 }
90} 86}