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 --- .../video-channel-videos/video-channel-videos.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'client/src/app/+video-channels/video-channel-videos') diff --git a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts index 599d38da9..e1ec6bbcb 100644 --- a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts +++ b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts @@ -6,7 +6,6 @@ import { AuthService, ConfirmService, LocalStorageService, Notifier, ScreenServi import { immutableAssign } from '@app/helpers' import { VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' import { AbstractVideoList } from '@app/shared/shared-video-miniature' -import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ selector: 'my-video-channel-videos', @@ -23,7 +22,6 @@ export class VideoChannelVideosComponent extends AbstractVideoList implements On private videoChannelSub: Subscription constructor ( - protected i18n: I18n, protected router: Router, protected serverService: ServerService, protected route: ActivatedRoute, @@ -38,7 +36,7 @@ export class VideoChannelVideosComponent extends AbstractVideoList implements On ) { super() - this.titlePage = this.i18n('Published videos') + this.titlePage = $localize`Published videos` this.displayOptions = { ...this.displayOptions, avatar: false @@ -72,7 +70,9 @@ export class VideoChannelVideosComponent extends AbstractVideoList implements On .getVideoChannelVideos(this.videoChannel, newPagination, this.sort, this.nsfwPolicy) .pipe( tap(({ total }) => { - this.titlePage = this.i18n(`{total, plural, =1 {Published 1 video} other {Published {{total}} videos}}`, { total }) + this.titlePage = total === 1 + ? $localize`Published 1 video` + : $localize`Published ${total} videos` }) ) } -- cgit v1.2.3