diff options
Diffstat (limited to 'client/src/app/shared/shared-video-playlist')
-rw-r--r-- | client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts | 8 | ||||
-rw-r--r-- | client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts | 13 |
2 files changed, 8 insertions, 13 deletions
diff --git a/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts index f611fc46b..757ffa099 100644 --- a/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts +++ b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts | |||
@@ -4,7 +4,6 @@ import { debounceTime, filter } from 'rxjs/operators' | |||
4 | import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core' | 4 | import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core' |
5 | import { AuthService, DisableForReuseHook, Notifier } from '@app/core' | 5 | import { AuthService, DisableForReuseHook, Notifier } from '@app/core' |
6 | import { FormReactive, FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms' | 6 | import { FormReactive, FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms' |
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
8 | import { Video, VideoExistInPlaylist, VideoPlaylistCreate, VideoPlaylistElementCreate, VideoPlaylistPrivacy } from '@shared/models' | 7 | import { Video, VideoExistInPlaylist, VideoPlaylistCreate, VideoPlaylistElementCreate, VideoPlaylistPrivacy } from '@shared/models' |
9 | import { secondsToTime } from '../../../assets/player/utils' | 8 | import { secondsToTime } from '../../../assets/player/utils' |
10 | import { CachedPlaylist, VideoPlaylistService } from './video-playlist.service' | 9 | import { CachedPlaylist, VideoPlaylistService } from './video-playlist.service' |
@@ -53,7 +52,6 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit, | |||
53 | protected formValidatorService: FormValidatorService, | 52 | protected formValidatorService: FormValidatorService, |
54 | private authService: AuthService, | 53 | private authService: AuthService, |
55 | private notifier: Notifier, | 54 | private notifier: Notifier, |
56 | private i18n: I18n, | ||
57 | private videoPlaylistService: VideoPlaylistService, | 55 | private videoPlaylistService: VideoPlaylistService, |
58 | private videoPlaylistValidatorsService: VideoPlaylistValidatorsService, | 56 | private videoPlaylistValidatorsService: VideoPlaylistValidatorsService, |
59 | private cd: ChangeDetectorRef | 57 | private cd: ChangeDetectorRef |
@@ -204,7 +202,7 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit, | |||
204 | this.videoPlaylistService.removeVideoFromPlaylist(playlist.id, playlist.playlistElementId, this.video.id) | 202 | this.videoPlaylistService.removeVideoFromPlaylist(playlist.id, playlist.playlistElementId, this.video.id) |
205 | .subscribe( | 203 | .subscribe( |
206 | () => { | 204 | () => { |
207 | this.notifier.success(this.i18n('Video removed from {{name}}', { name: playlist.displayName })) | 205 | this.notifier.success($localize`Video removed from ${playlist.displayName}`) |
208 | }, | 206 | }, |
209 | 207 | ||
210 | err => { | 208 | err => { |
@@ -262,8 +260,8 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit, | |||
262 | .subscribe( | 260 | .subscribe( |
263 | () => { | 261 | () => { |
264 | const message = body.startTimestamp || body.stopTimestamp | 262 | const message = body.startTimestamp || body.stopTimestamp |
265 | ? this.i18n('Video added in {{n}} at timestamps {{t}}', { n: playlist.displayName, t: this.formatTimestamp(playlist) }) | 263 | ? $localize`Video added in ${playlist.displayName} at timestamps ${this.formatTimestamp(playlist)}` |
266 | : this.i18n('Video added in {{n}}', { n: playlist.displayName }) | 264 | : $localize`Video added in ${playlist.displayName}` |
267 | 265 | ||
268 | this.notifier.success(message) | 266 | this.notifier.success(message) |
269 | }, | 267 | }, |
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts index 57a5fbe61..5879c4978 100644 --- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts +++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts | |||
@@ -2,7 +2,6 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, In | |||
2 | import { AuthService, Notifier, ServerService } from '@app/core' | 2 | import { AuthService, Notifier, ServerService } from '@app/core' |
3 | import { Video } from '@app/shared/shared-main' | 3 | import { Video } from '@app/shared/shared-main' |
4 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' | 4 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' |
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
6 | import { ServerConfig, VideoPlaylistElementType, VideoPlaylistElementUpdate } from '@shared/models' | 5 | import { ServerConfig, VideoPlaylistElementType, VideoPlaylistElementUpdate } from '@shared/models' |
7 | import { secondsToTime } from '../../../assets/player/utils' | 6 | import { secondsToTime } from '../../../assets/player/utils' |
8 | import { VideoPlaylistElement } from './video-playlist-element.model' | 7 | import { VideoPlaylistElement } from './video-playlist-element.model' |
@@ -44,7 +43,6 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { | |||
44 | private authService: AuthService, | 43 | private authService: AuthService, |
45 | private serverService: ServerService, | 44 | private serverService: ServerService, |
46 | private notifier: Notifier, | 45 | private notifier: Notifier, |
47 | private i18n: I18n, | ||
48 | private videoPlaylistService: VideoPlaylistService, | 46 | private videoPlaylistService: VideoPlaylistService, |
49 | private cdr: ChangeDetectorRef | 47 | private cdr: ChangeDetectorRef |
50 | ) {} | 48 | ) {} |
@@ -97,8 +95,7 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { | |||
97 | this.videoPlaylistService.removeVideoFromPlaylist(this.playlist.id, playlistElement.id, videoId) | 95 | this.videoPlaylistService.removeVideoFromPlaylist(this.playlist.id, playlistElement.id, videoId) |
98 | .subscribe( | 96 | .subscribe( |
99 | () => { | 97 | () => { |
100 | this.notifier.success(this.i18n('Video removed from {{name}}', { name: this.playlist.displayName })) | 98 | this.notifier.success($localize`Video removed from ${this.playlist.displayName}`) |
101 | |||
102 | this.elementRemoved.emit(playlistElement) | 99 | this.elementRemoved.emit(playlistElement) |
103 | }, | 100 | }, |
104 | 101 | ||
@@ -117,7 +114,7 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { | |||
117 | this.videoPlaylistService.updateVideoOfPlaylist(this.playlist.id, playlistElement.id, body, this.playlistElement.video.id) | 114 | this.videoPlaylistService.updateVideoOfPlaylist(this.playlist.id, playlistElement.id, body, this.playlistElement.video.id) |
118 | .subscribe( | 115 | .subscribe( |
119 | () => { | 116 | () => { |
120 | this.notifier.success(this.i18n('Timestamps updated')) | 117 | this.notifier.success($localize`Timestamps updated`) |
121 | 118 | ||
122 | playlistElement.startTimestamp = body.startTimestamp | 119 | playlistElement.startTimestamp = body.startTimestamp |
123 | playlistElement.stopTimestamp = body.stopTimestamp | 120 | playlistElement.stopTimestamp = body.stopTimestamp |
@@ -140,10 +137,10 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { | |||
140 | 137 | ||
141 | if (start === null && stop === null) return '' | 138 | if (start === null && stop === null) return '' |
142 | 139 | ||
143 | if (start !== null && stop === null) return this.i18n('Starts at ') + startFormatted | 140 | if (start !== null && stop === null) return $localize`Starts at ` + startFormatted |
144 | if (start === null && stop !== null) return this.i18n('Stops at ') + stopFormatted | 141 | if (start === null && stop !== null) return $localize`Stops at ` + stopFormatted |
145 | 142 | ||
146 | return this.i18n('Starts at ') + startFormatted + this.i18n(' and stops at ') + stopFormatted | 143 | return $localize`Starts at ` + startFormatted + $localize` and stops at ` + stopFormatted |
147 | } | 144 | } |
148 | 145 | ||
149 | onDropdownOpenChange () { | 146 | onDropdownOpenChange () { |