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 --- client/src/app/+videos/+video-edit/video-update.component.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'client/src/app/+videos/+video-edit/video-update.component.ts') diff --git a/client/src/app/+videos/+video-edit/video-update.component.ts b/client/src/app/+videos/+video-edit/video-update.component.ts index abd08f05c..2e1d0f89d 100644 --- a/client/src/app/+videos/+video-edit/video-update.component.ts +++ b/client/src/app/+videos/+video-edit/video-update.component.ts @@ -5,7 +5,6 @@ import { Notifier } from '@app/core' import { FormReactive, FormValidatorService, SelectChannelItem } from '@app/shared/shared-forms' import { VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit, VideoService } from '@app/shared/shared-main' import { LoadingBarService } from '@ngx-loading-bar/core' -import { I18n } from '@ngx-translate/i18n-polyfill' import { VideoPrivacy } from '@shared/models' @Component({ @@ -31,9 +30,8 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { private notifier: Notifier, private videoService: VideoService, private loadingBar: LoadingBarService, - private videoCaptionService: VideoCaptionService, - private i18n: I18n - ) { + private videoCaptionService: VideoCaptionService + ) { super() } @@ -78,7 +76,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { canDeactivate (): { canDeactivate: boolean, text?: string } { if (this.updateDone === true) return { canDeactivate: true } - const text = this.i18n('You have unsaved changes! If you leave, your changes will be lost.') + const text = $localize`You have unsaved changes! If you leave, your changes will be lost.` for (const caption of this.videoCaptions) { if (caption.action) return { canDeactivate: false, text } @@ -115,7 +113,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { this.updateDone = true this.isUpdatingVideo = false this.loadingBar.useRef().complete() - this.notifier.success(this.i18n('Video updated.')) + this.notifier.success($localize`Video updated.`) this.router.navigate([ '/videos/watch', this.video.uuid ]) }, -- cgit v1.2.3