aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-04 16:21:17 +0200
committerChocobozzz <me@florianbigard.com>2018-06-05 08:43:01 +0200
commitb1d40cff89f7cff565a98cdbcea9a624196a169a (patch)
treed24746c1cc69f50471a9eba0dfb1c1bae06a1870 /client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts
parent989e526abf0c0dd7958deb630df009608561bb67 (diff)
downloadPeerTube-b1d40cff89f7cff565a98cdbcea9a624196a169a.tar.gz
PeerTube-b1d40cff89f7cff565a98cdbcea9a624196a169a.tar.zst
PeerTube-b1d40cff89f7cff565a98cdbcea9a624196a169a.zip
Add i18n attributes
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.ts20
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'
6import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' 6import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
7import { User } from '@app/shared' 7import { User } from '@app/shared'
8import { flatMap } from 'rxjs/operators' 8import { flatMap } from 'rxjs/operators'
9import { 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