From 66357162f8e1227495f09bd4f68446aad7071c6d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 12 Aug 2020 10:40:04 +0200 Subject: 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 --- .../my-account-video-playlist-create.component.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts') diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts index e72ae2366..5427dc3a0 100644 --- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts +++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts @@ -1,13 +1,12 @@ import { Component, OnInit } from '@angular/core' import { Router } from '@angular/router' import { AuthService, Notifier, ServerService } from '@app/core' +import { populateAsyncUserVideoChannels } from '@app/helpers' import { FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms' import { VideoPlaylistService } from '@app/shared/shared-video-playlist' -import { I18n } from '@ngx-translate/i18n-polyfill' import { VideoPlaylistCreate } from '@shared/models/videos/playlist/video-playlist-create.model' import { VideoPlaylistPrivacy } from '@shared/models/videos/playlist/video-playlist-privacy.model' import { MyAccountVideoPlaylistEdit } from './my-account-video-playlist-edit' -import { populateAsyncUserVideoChannels } from '@app/helpers' @Component({ selector: 'my-account-video-playlist-create', @@ -24,9 +23,8 @@ export class MyAccountVideoPlaylistCreateComponent extends MyAccountVideoPlaylis private notifier: Notifier, private router: Router, private videoPlaylistService: VideoPlaylistService, - private serverService: ServerService, - private i18n: I18n - ) { + private serverService: ServerService + ) { super() } @@ -70,9 +68,7 @@ export class MyAccountVideoPlaylistCreateComponent extends MyAccountVideoPlaylis this.videoPlaylistService.createVideoPlaylist(videoPlaylistCreate).subscribe( () => { - this.notifier.success( - this.i18n('Playlist {{playlistName}} created.', { playlistName: videoPlaylistCreate.displayName }) - ) + this.notifier.success($localize`Playlist ${videoPlaylistCreate.displayName} created.`) this.router.navigate([ '/my-account', 'video-playlists' ]) }, @@ -85,6 +81,6 @@ export class MyAccountVideoPlaylistCreateComponent extends MyAccountVideoPlaylis } getFormButtonTitle () { - return this.i18n('Create') + return $localize`Create` } } -- cgit v1.2.3