diff options
Diffstat (limited to 'client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts')
-rw-r--r-- | client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts b/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts index 20c8798d1..cff1041f6 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts +++ b/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts | |||
@@ -6,6 +6,7 @@ import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | |||
6 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 6 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' |
7 | import { User } from '@app/shared' | 7 | import { User } from '@app/shared' |
8 | import { flatMap } from 'rxjs/operators' | 8 | import { flatMap } from 'rxjs/operators' |
9 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | 10 | ||
10 | @Component({ | 11 | @Component({ |
11 | selector: 'my-account-video-channels', | 12 | selector: 'my-account-video-channels', |
@@ -21,7 +22,8 @@ export class MyAccountVideoChannelsComponent implements OnInit { | |||
21 | private authService: AuthService, | 22 | private authService: AuthService, |
22 | private notificationsService: NotificationsService, | 23 | private notificationsService: NotificationsService, |
23 | private confirmService: ConfirmService, | 24 | private confirmService: ConfirmService, |
24 | private videoChannelService: VideoChannelService | 25 | private videoChannelService: VideoChannelService, |
26 | private i18n: I18n | ||
25 | ) {} | 27 | ) {} |
26 | 28 | ||
27 | ngOnInit () { | 29 | ngOnInit () { |
@@ -32,10 +34,13 @@ export class MyAccountVideoChannelsComponent implements OnInit { | |||
32 | 34 | ||
33 | async deleteVideoChannel (videoChannel: VideoChannel) { | 35 | async deleteVideoChannel (videoChannel: VideoChannel) { |
34 | const res = await this.confirmService.confirmWithInput( | 36 | const res = await this.confirmService.confirmWithInput( |
35 | `Do you really want to delete ${videoChannel.displayName}? It will delete all videos uploaded in this channel too.`, | 37 | this.i18n( |
36 | 'Please type the name of the video channel to confirm', | 38 | 'Do you really want to delete {{ videoChannelName }}? It will delete all videos uploaded in this channel too.', |
39 | { videoChannelName: videoChannel.displayName } | ||
40 | ), | ||
41 | this.i18n('Please type the name of the video channel to confirm'), | ||
37 | videoChannel.displayName, | 42 | videoChannel.displayName, |
38 | 'Delete' | 43 | this.i18n('Delete') |
39 | ) | 44 | ) |
40 | if (res === false) return | 45 | if (res === false) return |
41 | 46 | ||
@@ -43,10 +48,13 @@ export class MyAccountVideoChannelsComponent implements OnInit { | |||
43 | .subscribe( | 48 | .subscribe( |
44 | status => { | 49 | status => { |
45 | this.loadVideoChannels() | 50 | this.loadVideoChannels() |
46 | this.notificationsService.success('Success', `Video channel ${videoChannel.name} deleted.`) | 51 | this.notificationsService.success( |
52 | this.i18n('Success'), | ||
53 | this.i18n('Video channel {{ videoChannelName } deleted.', { videoChannelName: videoChannel.displayName }) | ||
54 | ) | ||
47 | }, | 55 | }, |
48 | 56 | ||
49 | error => this.notificationsService.error('Error', error.message) | 57 | error => this.notificationsService.error(this.i18n('Error'), error.message) |
50 | ) | 58 | ) |
51 | } | 59 | } |
52 | 60 | ||