diff options
Diffstat (limited to 'client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts')
-rw-r--r-- | client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts index e278d9ed2..f6cdf1067 100644 --- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts +++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts | |||
@@ -6,7 +6,6 @@ import { ComponentPagination, ConfirmService, Notifier, ScreenService } from '@a | |||
6 | import { DropdownAction } from '@app/shared/shared-main' | 6 | import { DropdownAction } from '@app/shared/shared-main' |
7 | import { VideoShareComponent } from '@app/shared/shared-share-modal' | 7 | import { VideoShareComponent } from '@app/shared/shared-share-modal' |
8 | import { VideoPlaylist, VideoPlaylistElement, VideoPlaylistService } from '@app/shared/shared-video-playlist' | 8 | import { VideoPlaylist, VideoPlaylistElement, VideoPlaylistService } from '@app/shared/shared-video-playlist' |
9 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
10 | import { VideoPlaylistType } from '@shared/models' | 9 | import { VideoPlaylistType } from '@shared/models' |
11 | 10 | ||
12 | @Component({ | 11 | @Component({ |
@@ -35,7 +34,6 @@ export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestro | |||
35 | 34 | ||
36 | constructor ( | 35 | constructor ( |
37 | private notifier: Notifier, | 36 | private notifier: Notifier, |
38 | private i18n: I18n, | ||
39 | private router: Router, | 37 | private router: Router, |
40 | private confirmService: ConfirmService, | 38 | private confirmService: ConfirmService, |
41 | private route: ActivatedRoute, | 39 | private route: ActivatedRoute, |
@@ -47,12 +45,12 @@ export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestro | |||
47 | this.playlistActions = [ | 45 | this.playlistActions = [ |
48 | [ | 46 | [ |
49 | { | 47 | { |
50 | label: this.i18n('Update playlist'), | 48 | label: $localize`Update playlist`, |
51 | iconName: 'edit', | 49 | iconName: 'edit', |
52 | linkBuilder: playlist => [ '/my-account', 'video-playlists', 'update', playlist.uuid ] | 50 | linkBuilder: playlist => [ '/my-account', 'video-playlists', 'update', playlist.uuid ] |
53 | }, | 51 | }, |
54 | { | 52 | { |
55 | label: this.i18n('Delete playlist'), | 53 | label: $localize`Delete playlist`, |
56 | iconName: 'delete', | 54 | iconName: 'delete', |
57 | handler: playlist => this.deleteVideoPlaylist(playlist) | 55 | handler: playlist => this.deleteVideoPlaylist(playlist) |
58 | } | 56 | } |
@@ -126,11 +124,8 @@ export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestro | |||
126 | 124 | ||
127 | async deleteVideoPlaylist (videoPlaylist: VideoPlaylist) { | 125 | async deleteVideoPlaylist (videoPlaylist: VideoPlaylist) { |
128 | const res = await this.confirmService.confirm( | 126 | const res = await this.confirmService.confirm( |
129 | this.i18n( | 127 | $localize`Do you really want to delete ${videoPlaylist.displayName}?`, |
130 | 'Do you really want to delete {{playlistDisplayName}}?', | 128 | $localize`Delete` |
131 | { playlistDisplayName: videoPlaylist.displayName } | ||
132 | ), | ||
133 | this.i18n('Delete') | ||
134 | ) | 129 | ) |
135 | if (res === false) return | 130 | if (res === false) return |
136 | 131 | ||
@@ -138,10 +133,7 @@ export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestro | |||
138 | .subscribe( | 133 | .subscribe( |
139 | () => { | 134 | () => { |
140 | this.router.navigate([ '/my-account', 'video-playlists' ]) | 135 | this.router.navigate([ '/my-account', 'video-playlists' ]) |
141 | 136 | this.notifier.success($localize`Playlist ${videoPlaylist.displayName} deleted.`) | |
142 | this.notifier.success( | ||
143 | this.i18n('Playlist {{playlistDisplayName}} deleted.', { playlistDisplayName: videoPlaylist.displayName }) | ||
144 | ) | ||
145 | }, | 137 | }, |
146 | 138 | ||
147 | error => this.notifier.error(error.message) | 139 | error => this.notifier.error(error.message) |