diff options
author | Chocobozzz <me@florianbigard.com> | 2020-08-12 10:40:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-08-14 10:28:30 +0200 |
commit | 66357162f8e1227495f09bd4f68446aad7071c6d (patch) | |
tree | 7d4429506deb512b2fe1d0267f38a28cda20af55 /client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts | |
parent | 8c360747995e17eb5520e22fc3d7bd4c3d26eeee (diff) | |
download | PeerTube-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/shared/shared-video-playlist/video-add-to-playlist.component.ts')
-rw-r--r-- | client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts | 8 |
1 files changed, 3 insertions, 5 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 | }, |